docs
evals
scenario-1
scenario-2
scenario-3
scenario-4
scenario-5
scenario-6
scenario-7
scenario-8
scenario-9
scenario-10
Create a tiny helper that registers predictable HTTP/HTTPS responses for a single service base URL so integration-style tests can call the service without leaving the process. The helper should define single-use interceptors per path and HTTP verb, and expose a way to verify that every expected call was exercised.
assertAllConsumed throws an error that lists any paths or verbs that were not exercised; calling reset clears all registrations and pending expectations for a fresh run. @testexport function createHttpMockHarness(baseUrl) {
return {
registerGet(path, responseBody, statusCode = 200) {},
registerPost(path, expectedBody, responseBody, statusCode = 201) {},
assertAllConsumed() {},
reset() {},
};
}HTTP interception library for mocking HTTP/HTTPS requests during tests.