I'm having a strange issue with PollyJS and Jest. I have 2 tests in a single file -- the first one passes, and the second returns an error from the fetch in MyComponent: TypeError: Cannot read property 'status' of undefined"
It doesn't matter which one is second. Standalone each test passes, but together the second fails so it looks like Polly is just not doing the fetch from it's recordings.
I've tried various things like context.polly.flush() in afterEach but it doesn't seem to work. Any ideas? I think it's because setup-polly-jest calls context.polly.stop() but the examples show multiple tests running.
Hey @stbenjam as you correctly noticed we do run miltiple tests in one file and they are passing wihout any issues so unless you can create a minimal reproduction, there's not much I can do to help you figure it out
I'm having a strange issue with PollyJS and Jest. I have 2 tests in a single file -- the first one passes, and the second returns an error from the fetch in MyComponent: TypeError: Cannot read property 'status' of undefined"
It doesn't matter which one is second. Standalone each test passes, but together the second fails so it looks like Polly is just not doing the fetch from it's recordings.
I've tried various things like context.polly.flush() in afterEach but it doesn't seem to work. Any ideas? I think it's because setup-polly-jest calls context.polly.stop() but the examples show multiple tests running.
Polly config:
My test file: