🎁 Get the FREE AI Skills Starter Guide β€” Subscribe β†’
BytesAgainBytesAgain
πŸ¦€ ClawHub

Redux Saga Testing

by @anivar

Write tests for Redux Sagas using redux-saga-test-plan, runSaga, and manual generator testing. Covers expectSaga (integration), testSaga (unit), providers, p...

Versionv1.0.1
πŸ”’ Constraints

1. Prefer expectSaga over testSaga β€” integration tests don't break on refactors 2. Use matchers.call.fn() for partial matching β€” don't couple to exact args unless necessary 3. Use throwError() from providers β€” not throw new Error() in the provider 4. Test with reducer using .withReducer() + .hasFinalState() to verify state 5. Dispatch actions with .dispatch() to simulate user flows in tests 6. Return the promise (Jest) or await it (Vitest) β€” don't forget async 7. Use .not.put() to assert actions are NOT dispatched (negative tests) 8. Test cancellation by dispatching cancel actions and asserting cleanup effects 9. Use .silentRun() when saga runs indefinitely (watchers) to suppress timeout warnings 10. Don't test implementation β€” test behavior (what actions are dispatched, what state results)

View on ClawHub
TERMINAL
clawhub install redux-saga-testing

πŸ§ͺ Use this skill with your agent

Most visitors already have an agent. Pick your environment, install or copy the workflow, then run the smoke-test prompt above.

πŸ” Can't find the right skill?

Search 60,000+ AI agent skills β€” free, no login needed.

Search Skills β†’