Attaches the request hooks to the test. Can be chained with other
t.addRequestHooks(...hooks) → this | Promise<any>
||RequestHook subclass||A RequestLogger, RequestMock or custom user-defined hook.|
t.addRequestHooksmethod uses the rest operator that allows you to pass multiple hooks as parameters or arrays of hooks.
Once a request hook is attached, it intercepts HTTP requests sent during the subsequent test actions.
You can also use the test.requestHooks and fixture.requestHooks methods to attach request hooks to an individual test or a fixture. These methods attach hooks before test code starts, so they can handle all HTTP requests the page sends.
Use the t.removeRequestHooks method to remove attached request hooks.