Not matching mocks are hard to debug
See original GitHub issueBug Description
When a mock does not match (and net.connect is disabled), we error with a generic:
Unable to find mock dispatch and real dispatches are disabled for XYZ
However, we are likely setting up a mock for this URL - so there might be something that is not matching.
We should provide better error messages.
Issue Analytics
- State:
- Created 2 years ago
- Reactions:1
- Comments:7 (7 by maintainers)
Top Results From Across the Web
How to Debug Mockery Expectations - Hi! I'm Albert
But as it's usual with mocks sometimes get very hard to debug because of it's way of working. It basically works setting some...
Read more >"Error: Nock: No match for request" How to quickly understand ...
I used to use nock(apiUrl).persist().log(console.log) (link) that was doing the job pretty well. But it's been deprecated and I've recently ...
Read more >Debugging Apollo GraphQL MockedProvider - Swarmia
1. Add logging with MockLink. Queries fail silently during a test case if the MockedProvider doesn't find a matching mock for the given...
Read more >A Unit Testing Practitioner's Guide to Everyday Mockito - Toptal
What is mocking? Obviously, it's not where you make fun of your fellow developers. Mocking for unit testing is when you create an...
Read more >Creating Mock Classes
If a mock method has no EXPECT_CALL spec but is called, Google Mock will ... is lengthy and hard to work with (let's...
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
Ah okay, no problem - I’ll get right on that and try and think of other situations that need more info as well!
It would work but it needs to be more nuanced. For example, express that there was a body or header or XYZ mismatch.