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.

Not matching mocks are hard to debug

See original GitHub issue

Bug 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:closed
  • Created 2 years ago
  • Reactions:1
  • Comments:7 (7 by maintainers)

github_iconTop GitHub Comments

1reaction
jonnydgreencommented, May 6, 2021

Ah okay, no problem - I’ll get right on that and try and think of other situations that need more info as well!

1reaction
mcollinacommented, May 5, 2021

It would work but it needs to be more nuanced. For example, express that there was a body or header or XYZ mismatch.

Read more comments on GitHub >

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

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