🔧 Test toolkit for prismy.
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!'
})
})
})
})
MIT