Skip to content

jaktestowac/awesome-copilot-for-testers / plugins/mocking-network-and-time/skills/mocking-network-and-time

mocking-network-and-time

Verified

Decides 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.

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
finishing-a-development-branchobra/superpowersUse when implementation is complete, all tests pass, and you need to decide how to integrate the workStars: 322kUpdated Claude CodeCodexVerifiedInstall
systematic-debuggingobra/superpowersUse when encountering any bug, test failure, or unexpected behavior, before proposing fixesStars: 322kUpdated Claude CodeCodexVerifiedInstall
test-driven-developmentobra/superpowersUse when implementing any feature or bugfix, before writing implementation codeStars: 322kUpdated Claude CodeCodexVerifiedInstall
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: 198kUpdated Claude CodeCodexVerifiedInstall