question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Cannot load definitions after calling `nock.restore()`

See original GitHub issue

After 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:closed
  • Created 7 years ago
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
Urthencommented, Aug 25, 2017

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 of activate.

0reactions
lock[bot]commented, Sep 13, 2018

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!

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found