Skip to content
Discussion options

You must be logged in to vote

Hi, @cmacdonnacha 👋 Great to see you updating.

First thing to point out, v0 and v1 are practically the same, in a sense that v1 doesn't include any breaking changes (the package got bumped to v1 accidentally and we rolled with it because the APIs have been stabled for years at that point).

MSW never had any implicit delays, you always have to define one yourself.

In your case, I recommend adding a delay to the matching request handler only in the disabled button state test case. Rely on the fallthrough so you don't have to repeat the resolver implementation:

test('...', async () => {
  server.use(
    rest.get('/resource', async (req, res, ctx) => {
      await ctx.delay('infinite')
    })

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
@cmacdonnacha
Comment options

Answer selected by kettanaito
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