Skip to content

Return statement on response resolver is not covered according to Jest #942

Answered by kettanaito
joekrall asked this question in Q&A
Discussion options

You must be logged in to vote

Hey, @krallj.

The logic you write with MSW is often meant to help during testing. Although you can test it, there's little practical benefit to doing that. If the mocking logic is incorrect, the test should fail. If it doesn't, there are even bigger issues going on.

Exclude the MSW setup from test coverage, unless you wish to write tests for your setup (which you should have a really strong reason to do). MSW itself is rather well tested, so if you ever decide on introducing extra tests, they'd be scoped to your own logic that you put into MSW. Your own tests are the reflection of that logic's intentions. Rely on your tests.

Replies: 2 comments 1 reply

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
1 reply
@joekrall
Comment options

Answer selected by joekrall
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants