Skip to content

prismyland/prismy-test

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

28 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

prismy-test

🔧 Test toolkit for prismy.

Build Status codecov NPM download Language grade: JavaScript

import got from 'got'
import { prismy, res } from 'prismy'
import { testHandler } from 'prismy-test'

describe('testServer', () => {
  it('tests server', async () => {
    const handler = prismy([], () => {
      return res('Hello, World!')
    })

    await testHandler(handler, async url => {
      const result = await got(url)

      expect(result).toMatchObject({
        body: 'Hello, World!'
      })
    })
  })
})

License

MIT