• Create a microtest runner. This runner can be used to make requests, parse the results, and make assertions about the response.

    Parameters

    • baseURL: string

      The base url that all requests should be made to

    • config: RunnerConfiguration = {}

      Optionally, a configuration object customizing the behavior of the request builder

    Returns ((callback) => ResponseParser)

    a function that can be used to make and parse HTTP requests

    Example

    const request = microtest('http://localhost:9999')
    const response = await request(ctx => ctx.get('/').query({ foo: 'bar' })).status(200).json()
    expect(response.message).toEqual('something from my api')

Generated using TypeDoc