RequestMock Constructor

Creates a request mocker.


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.

import { RequestMock, Selector } from 'testcafe';

const mock = RequestMock()
    .respond('', 404);


test('Should mock requests', async t => {
    await t