/prismy-test

:wrench: Test toolkit for prismy

Primary LanguageTypeScript

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