jaktestowac/awesome-copilot-for-testers / plugins/mocking-network-and-time/skills/mocking-network-and-time
mocking-network-and-time
VerifiedDecides what to fake and stubs it correctly: network interception with Playwright route or HAR replay, MSW handlers, fake clocks, and fixed timezones. Use when a test depends on a third party, when a date-sensitive test breaks overnight, when a suite is slow because it calls real services, or when a mocked test stays green while production is broken.
| File | Kind | Size |
|---|---|---|
| SKILL.md | skill md | 9.2 KB |
| resources/clock-and-timezone.md | markdown | 4.3 KB |
| resources/mocking-decision-record.md | markdown | 1.7 KB |
| resources/msw-recipes.md | markdown | 3.9 KB |
| resources/playwright-route-recipes.md | markdown | 4.4 KB |
| resources/when-to-mock.md | markdown | 3.3 KB |
resources/mocking-decision-record.md
View on GitHub# Mocking Decision Record
Keep this next to the fixtures or in the test suite README. One record per mocked dependency, not per test.
---
## [Dependency name]
- **Owned by us**: [yes / no]
- **Mocked at**: [Playwright route / HAR replay / MSW / module boundary / fake clock]
- **Applies to**: [which suites or tags]
- **Reason**: [the specific nondeterminism this removes: rate limit, cost, outage, wall clock, shared sandbox]
### What this stops the suite catching
- [e.g. breaking changes to the provider's response shape]
- [e.g. real latency and timeout behaviour]
### Drift guard
- **Type**: [contract check / HAR refresh / unmocked smoke test / none]
- **Command**: `[how to run or refresh]`
- **Cadence**: [per commit / nightly / per release / on demand]
- **Last verified**: [YYYY-MM-DD]
### Review trigger
- [what event should force a re-check: provider version bump, incident, spec change]
---
## Worked example
## Stripe payments API
- **Owned by us**: no
- **Mocked at**: Playwright `context.route` for negative cases; provider sandbox for the happy path
- **Applies to**: `@checkout` tagged E2E suite
- **Reason**: the sandbox cannot produce card-declined and 3DS-timeout responses on demand, and it rate-limits under parallel runs
### What this stops the suite catching
- changes to Stripe's error payload shape
- real 3DS redirect behaviour in the declined path
- rate-limit handling under production traffic patterns
### Drift guard
- **Type**: unmocked smoke test
- **Command**: `npx playwright test --grep @payments-live`
- **Cadence**: nightly against the sandbox
- **Last verified**: 2026-08-14
### Review trigger
- Stripe API version bump in `package.json`, or any payments incident
Related skills
| Skill | Stars | Updated | Works with | Status | Install |
|---|---|---|---|---|---|
| finishing-a-development-branchobra/superpowersUse when implementation is complete, all tests pass, and you need to decide how to integrate the work | Stars: 322k | Updated | Claude CodeCodex | Verified | Install |
| systematic-debuggingobra/superpowersUse when encountering any bug, test failure, or unexpected behavior, before proposing fixes | Stars: 322k | Updated | Claude CodeCodex | Verified | Install |
| test-driven-developmentobra/superpowersUse when implementing any feature or bugfix, before writing implementation code | Stars: 322k | Updated | Claude CodeCodex | Verified | Install |
| skill-creatoranthropics/skillsCreate new skills, modify and improve existing skills, and measure skill performance. Use when users want to create a skill from scratch, edit, or optimize an existing skill, run evals to test a skill, benchmark skill performance with variance analysis, or optimize a skill's description for better triggering accuracy. | Stars: 198k | Updated | Claude CodeCodex | Verified | Install |