Along with custom header transport, it would be useful to support cookie transport of mocks. It will make easier integration with test runners and other tools (e.g. browser extensions).
Proof of concept
We can serialize mocks into a cookie named x-mock-request and check this cookie on server.
Caveats
Header is stateless, but cookie is stateful. Maybe we need to provide methods to clear the mocking cookie.
Along with custom header transport, it would be useful to support cookie transport of mocks. It will make easier integration with test runners and other tools (e.g. browser extensions).
Proof of concept
We can serialize mocks into a cookie named
x-mock-requestand check this cookie on server.Caveats
Header is stateless, but cookie is stateful. Maybe we need to provide methods to clear the mocking cookie.