Unmatched requests get logged to the console.
See original GitHub issueThe lib/index.js
file is built via webpack and has a console.warn
in it in the match
function from node-match-path
:
/**
* Matches a given url against a path.
*/
const match = (path, url) => {
const expression = path instanceof RegExp ? path : pathToRegExp(path);
const match = expression.exec(url) || false;
// Matches in strict mode: match string should equal to input (url)
// Otherwise loose matches will be considered truthy:
// match('/messages/:id', '/messages/123/users') // true
const matches = !!match && match[0] === match.input;
console.warn('nmp', { path, url, match, matches })
return {
matches,
params: match && matches ? match.groups || null : null,
};
};
But no version of node-match-path
has a console.warn
in it. Could we get a rebuild of this and a publish to get rid of that warning? It’s kind of distracting 😅
Thanks!
Issue Analytics
- State:
- Created 4 years ago
- Reactions:1
- Comments:6 (4 by maintainers)
Top Results From Across the Web
How to: let unmatched requests passthrough and reach the ...
I only want fetch-mock to create mock responses for only the registered matchers. If a request doesn't match any matchers then I want...
Read more >How to see if nock is matching the request or not?
Is there a way one can log information on console regarding nock is matching or not to the requests being made?
Read more >Verifying whether specific HTTP requests were made | WireMock
Verifying and querying requests relies on the request journal, which is an in-memory log of received requests. This can be disabled for load...
Read more >Logging & Debugging - MockServer
The simplest way to debug MockServer is to use the UI to view logs, requests and expectations. Retrieving Active Expectations.
Read more >Troubleshoot alerts on the SEM Console
This section describes how to troubleshoot unmatched data or internal new connector data alerts that may appear in your SEM console.
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 FreeTop 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
Top GitHub Comments
For anybody arriving here like me wanting to log requests, you can use this technique:
The lack of
return
means that other handlers can still serve the request after it is logged.Hey, @bargar! Thanks for posting this for others.
Note that MSW logs out requests that were matched, meaning their responses were mocked. However, you can see those requests and other requests in the “Network” tab of your browser. Sometimes extra logging to the console may not be necessary: just look into the “Network”.