You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Dec 16, 2023. It is now read-only.
Replay needs a cleanup function.
I tried this at the start of index.js (for use in a before block in a mocha test):
const HTTP = require('http');
const HTTPS = require('https');
const DNS = require('dns');
const origHttpRequest = HTTP.request;
const origHttpGet = HTTP.get;
const origHttpsGet = HTTPS.get;
const originalLookup = DNS.lookup;
restore() {
HTTP.request = origHttpRequest;
HTTP.get = origHttpGet;
HTTPS.get = origHttpsGet;
DNS.lookup = originalLookup;
}
But I missed something because this still has problems when people use nock or sinon, and we would need something for the before block to undo this.
The text was updated successfully, but these errors were encountered: