Open etodanik opened 2 years ago
P.S I am aware that testSaga
is made for unit tests, but I have to test channels, which aren't really supported by testSaga. It'd still be nice to be able to test order of things.
+1 to this feature. I find myself prefixing a lot of conditional behavior with .not
From what I see currently,
expectSaga()
only fails a test if an effect was expected, but that effect was run with the wrong arguments.Given the same saga:
✅ For example, this will pass:
✅ This will also pass (we totally don't test for any calls):
✅ Even this will pass (even though we are missing a test for
call
in between there):🚨 Only this will fail:
This is highly problematic behaviour for me because it leaves a lot of room for random and unexpected effects to be yielded without the test alerting me to it.
Is there a way to make expectSaga() strict? I would love it if it fails the test if we skipped an effect, or called effects in the wrong order.