Inspired by create-test-server.
yarn add @ianwalter/test-server --dev
const { test } = require('@ianwalter/bff')
const { createKoaServer } = require('@ianwalter/test-server')
const { requester } = require('@ianwalter/requester')
test('requester', ({ expect }) => {
const server = await createKoaServer()
server.use(ctx => (ctx.body = 'Hello World!'))
const response = await requester.get(server.url)
expect(response.body).toBe('Hello World!')
await server.close()
})
Apache 2.0 with Commons Clause - See LICENSE
Created by Ian Walter