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.

Record for a given URL only while mocking requests to other domains

See original GitHub issue

Is it possible to execute nock.recorder.rec() but only record a specific domain?

sometimes when testing i would like some APIs calls to actually go through but only a given domain to be recorded.

thank you

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:6 (4 by maintainers)

github_iconTop GitHub Comments

2reactions
gr2mcommented, Jul 31, 2018

You can’t record and intercept at the same time I’m afraid 😦 When you start recording than the interception gets disabled. But I see how this could be a valid use case, maybe something we could add in future?

1reaction
hemscommented, Aug 3, 2018

that would be great, like if “recorder.rec()” could take a “domain” or rule so only those would be recorded, this would be sweet!

Read more comments on GitHub >

github_iconTop Results From Across the Web

Record and Playback an API to Create a Mock - WireMock
Enter the URL you wish to record from in the target URL field and click the Record button.
Read more >
Request matching - Basics - Mock Service Worker Docs
* request handlers allows you to match requests by the following criteria: Request method;; Request URL. Query parameters and hashes are removed ...
Read more >
Can WireMock play back requests from multiple domains?
The only clear recording of a URL is in the final entry against proxyBaseUrl , and given that I had to specify a...
Read more >
Creating Responses - Requests-Mock - Read the Docs
The most simple method is to use a dictionary interface. The Key and value of the dictionary are turned directly into the name...
Read more >
Requests Mock Documentation - Read the Docs
Session) If set, only the given session instance is mocked (see Mocking ... When nesting mockers the innermost Mocker replaces all others.
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