Replies: 1 comment
-
You can use |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
With axios I would either
spyOn(axios, 'get')
or useaxios-mock-adapter
asexpect(appApiMock.history.get).toHaveLength(0)
Here it seems that I have two options, neither one is ideal:
nock.disableNetConnect()
This makes any requests fail, but that doesn't necessarily immediately throw, so if a test fail the reason is not immediately clear.
create a dummy mock
I can use
nock(the host).get('/*').reply(200)
to catch any requests and then call.isDone()
but that's verbose and needlessly specific.spyOn(globalThis, 'fetch')
I suppose this could work, once #2397 is resolved, but that means I don't need
nock
in this case.Beta Was this translation helpful? Give feedback.
All reactions