RequestMock Constructor

Creates a request mocker.

RequestMock()

Use the requestMock.onRequestTo method followed by respond to define which request should be mocked and specify the responses. Then, attach the mock to a test or fixture.

var mock = RequestMock()
    .onRequestTo(/google.com/)
    .respond('', 404);

fixture `My Fixture`
    .requestHooks(mock);

test('My test', async t => {
    /* ... */
});