Cannot load definitions after calling `nock.restore()`
See original GitHub issueAfter calling nock.restore()
I am not longer able to get use nock’s nock.define()
method to intercept requests. This may be a specific example of a more generalized problem: nock.restore()
does not return nock
to its original state.
Issue Analytics
- State:
- Created 7 years ago
- Comments:5 (3 by maintainers)
Top Results From Across the Web
node.js - Nock not working for multiple tests running together
Solution 1: Remove nock.restore() . Solution 2: Have this before() method in your test.
Read more >nock - npm
In order to stop recording you should call nock.restore() and recording will stop. ATTENTION!: when recording is enabled, nock does no ...
Read more >How to use the nock.load function in nock - Snyk
To help you get started, we've selected a few nock.load examples, ... some HTTP calls const nockCalls = nock.recorder.play() /// output_objects option ...
Read more >nock reset between tests | The AI Search Engine You Control
1 Answer Sorted by: 5 As discussed in this Github Issue, nock.restore () removes the http interceptor itself. When you run nock.isActive ()...
Read more >HTTP Server mocking for Node.js
removeInterceptor (options); function nock.restore (); function nock.scope (basePath, options) ... function load(path) { return define(loadDefs(path)); }
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Sorry to necro this issue, but is
activate
documented anywhere?We’d like to do
restore()
after each set of tests and running into what I assume is the same issue, but this is the first time I heard ofactivate
.This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue and add a reference to this one if it’s related. Thank you!