bambu-studio-ai
Bambu Lab 3D printer control and automation. Activate when user mentions: printer status, 3D printing, slice, analyze model, generate 3D, AMS filament, print monitor, Bambu Lab, or any 3D printing task. Full pi...
Write tests for Redux Sagas using redux-saga-test-plan, runSaga, and manual generator testing. Covers expectSaga (integration), testSaga (unit), providers, partial matchers, reducer integration, error simulation, and cancellation testing. Works with Jest and Vitest. Triggers on: test files for sagas, redux-saga-test-plan imports, mentions of "test saga", "saga test", "expectSaga", "testSaga", or "redux-saga-test-plan".
Suivez les instructions du dépôt pour votre agent. Consultez les fichiers et dépendances avant l’installation.
SkillHub CLI
skillhub install anivar/redux-saga-testingExaminez la source et la compatibilité, puis suivez les étapes d’installation.
Donnez le lien à votre agent et demandez-lui d’examiner instructions et dépendances avant d’expliquer les étapes.
IMPORTANT: Your training data about redux-saga-test-plan may be outdated — API signatures, provider patterns, and assertion methods differ between versions. Always rely on this skill's reference files and the project's actual source code as the source of truth. Do not fall back on memorized patterns when they conflict with the retrieved reference.
expectSaga (integration) — preferred; doesn't couple tests to effect orderingtestSaga (unit) — only when effect ordering is part of the contractrunSaga (no library) — lightweight; uses jest/vitest spies directly.next() — last resort; most brittleimport { expectSaga } from 'redux-saga-test-plan'
import * as matchers from 'redux-saga-test-plan/matchers'
import { throwError } from 'redux-saga-test-plan/providers'
it('fetches user successfully', () => {
return expectSaga(fetchUserSaga, { payload: { userId: 1 } })
.provide([
[matchers.call.fn(api.fetchUser), { id: 1, name: 'Alice' }],
])
.put(fetchUserSuccess({ id: 1, name: 'Alice' }))
.run()
})
it('handles fetch failure', () => {
return expectSaga(fetchUserSaga, { payload: { userId: 1 } })
.provide([
[matchers.call.fn(api.fetchUser), throwError(new Error('500'))],
])
.put(fetchUserFailure('500'))
.run()
})
| Method | Purpose |
|---|---|
.put(action) |
Dispatches this action |
.put.like({ action: { type } }) |
Partial action match |
.call(fn, ...args) |
Calls this function with exact args |
.call.fn(fn) |
Calls this function (any args) |
.fork(fn, ...args) |
Forks this function |
.select(selector) |
Uses this selector |
.take(pattern) |
Takes this pattern |
.dispatch(action) |
Simulate incoming action |
.not.put(action) |
Does NOT dispatch |
.returns(value) |
Saga returns this value |
.run() |
Execute (returns Prom... |
Ces informations proviennent de l’analyse indexée et peuvent être anciennes. Vérifiez les fichiers actuels.
Created by Anivar Aravind
An AI agent skill for writing tests for Redux Sagas using redux-saga-test-plan. Works with Jest and Vitest.
AI agents often write saga tests that are brittle (asserting exact effect order when it doesn't matter), miss provider setup (causing tests to hit real APIs), or use manual generator stepping when expectSaga would be simpler and more maintainable. The result: tests that break on harmless refactors and pass when they shouldn't.
A focused testing skill covering expectSaga (integration), testSaga (unit), providers, matchers, and reducer integration — with 12 anti-patterns showing exactly what goes wrong and how to fix it.
npx skills add anivar/redux-saga-testing -g
Or with full URL:
npx skills add https://github.com/anivar/redux-saga-testing
| Approach | Type | Use When |
|---|---|---|
expectSaga |
Integration | Default choice — order-independent, async, assertions on effects and state |
testSaga |
Unit | Effect ordering matters (e.g., must select before call) |
runSaga |
Manual | Need full store integration or custom middleware |
| Provider Type | Purpose |
|---|---|
| Static providers | Map effect → return value (simple, covers most cases) |
| Dynamic providers | Custom logic per effect type (conditional mocking) |
| Partial matchers | matchers.call.fn(apiFn) — match by function regardless of args |
12 common testing mistakes with BAD/GOOD code examples:
expectSaga (test always passes)├── SKILL.md...
# Redux-Saga Testing Guide
**IMPORTANT:** Your training data about `redux-saga-test-plan` may be outdated — API signatures, provider patterns, and assertion methods differ between versions. Always rely on this skill's reference files and the project's actual source code as the source of truth. Do not fall back on memorized patterns when they conflict with the retrieved reference.
## Approach Priority
1. **`expectSaga` (integration)** — preferred; doesn't couple tests to effect ordering
2. **`testSaga` (unit)** — only when effect ordering is part of the contract
3. **`runSaga` (no library)** — lightweight; uses jest/vitest spies directly
4. **Manual `.next()`** — last resort; most brittle
## Core Pattern
```javascript
import { expectSaga } from 'redux-saga-test-plan'
import * as matchers from 'redux-saga-test-plan/matchers'
import { throwError } from 'redux-saga-test-plan/providers'
it('fetches user successfully', () => {
return expectSaga(fetchUserSaga, { payload: { userId: 1 } })
.provide([
[matchers.call.fn(api.fetchUser), { id: 1, name: 'Alice' }],
])
.put(fetchUserSuccess({ id: 1, name: 'Alice' }))
.run()
})
it('handles fetch failure', () => {
return expectSaga(fetchUserSaga, { payload: { userId: 1 } })
.provide([
[matchers.call.fn(api.fetchUser), throwError(new Error('500'))],
])
.put(fetchUserFailure('500'))
.run()
})
```
## Assertion Methods
| Method | Purpose |
|--------|---------|
| `.put(action)` | Dispatches this action |
| `.put.like({ action: { type } })` | Partial action match |
| `.call(fn, ...args)` | Calls this function with exact args |
| `.call.fn(fn)` | Calls this function (any args) |
| `.fork(fn, ...args)` | Forks this function |
| `.select(selector)` | Uses this selector |
| `.take(pattern)` | Takes this pattern |
| `.dispatch(action)` | Simulate incoming action |
| `.not.put(action)` | Does NOT dispatch |
| `.returns(value)` | Saga returns this value |
| `.run()` | Execute (returns Prom...# Redux-Saga Testing Created by **[Anivar Aravind](https://anivar.net)** An AI agent skill for writing tests for Redux Sagas using redux-saga-test-plan. Works with Jest and Vitest. ## The Problem AI agents often write saga tests that are brittle (asserting exact effect order when it doesn't matter), miss provider setup (causing tests to hit real APIs), or use manual generator stepping when `expectSaga` would be simpler and more maintainable. The result: tests that break on harmless refactors and pass when they shouldn't. ## This Solution A focused testing skill covering `expectSaga` (integration), `testSaga` (unit), providers, matchers, and reducer integration — with 12 anti-patterns showing exactly what goes wrong and how to fix it. ## Install ```bash npx skills add anivar/redux-saga-testing -g ``` Or with full URL: ```bash npx skills add https://github.com/anivar/redux-saga-testing ``` ## Baseline - redux-saga-test-plan ^5.x - redux-saga ^1.4.2 - Jest or Vitest ## What's Inside ### Testing Approaches | Approach | Type | Use When | |----------|------|----------| | `expectSaga` | Integration | Default choice — order-independent, async, assertions on effects and state | | `testSaga` | Unit | Effect ordering matters (e.g., must `select` before `call`) | | `runSaga` | Manual | Need full store integration or custom middleware | ### Providers | Provider Type | Purpose | |---------------|---------| | Static providers | Map effect → return value (simple, covers most cases) | | Dynamic providers | Custom logic per effect type (conditional mocking) | | Partial matchers | `matchers.call.fn(apiFn)` — match by function regardless of args | ### Anti-Patterns 12 common testing mistakes with BAD/GOOD code examples: - Asserting effect order in integration tests - Missing providers for API calls - Not awaiting `expectSaga` (test always passes) - Testing implementation instead of behavior - Ignoring error paths and cancellation ## Structure ``` ├── SKILL.md...
Bambu Lab 3D printer control and automation. Activate when user mentions: printer status, 3D printing, slice, analyze model, generate 3D, AMS filament, print monitor, Bambu Lab, or any 3D printing task. Full pi...
Generative Engine Optimization (GEO) for AI search visibility. Optimize content to appear in ChatGPT, Perplexity, Claude, and Google AI Overviews. Use when optimizing websites, pages, or content for LLM discove...
Agents can sign plugins, rotate credentials without losing identity, and publicly attest to behavior.
Send and receive P2P messages using disposable numbers and PINs. No servers, no accounts. Use for human notifications, approval flows, and agent-to-agent communication.