http2spy
Spy on nodejs' built-in http2 module and assert against requests that have been performed:
const assert = ;const http2spy = ;const myClient = http2spy; // do something with your http2 API client, e.g.,// client.request({ ":method": "GET", ":path": "/" }); // now examine the requests:assert;
Passing Additional Stubs
http2spy is just a thin wrapper on top of proxyquire, if you would like to pass additional libraries to stub, simply provide them as a second parameter:
const myClient = http2spy;
License
Apache Version 2.0