Skip to content
Back to skills

Testing Workflow

ASecurity

How to test a change: test first, what to cover, what to mock, and the anti-patterns that let tests pass without proving anything. Use when writing or planning tests, mocking a dependency, fixing a flaky test, or checking coverage.

  • 80 stars
  • 0 votes
  • 0 copies
  • 0 views
  • Added May 28, 2026
ai-agentstestingapidatabase

Works with

  • api

Security analysis

A100/100

Scanned October 7, 2026

npx -y skills add monkilabs/opencastle --skill testing-workflow --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Testing Workflow?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Testing Workflow
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/monkilabs-testing-workflow/badge)](https://www.skillsdirectory.com/skills/monkilabs-testing-workflow)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: testing-workflow
description: "How to test a change: test first, what to cover, what to mock, and the anti-patterns that let tests pass without proving anything. Use when writing or planning tests, mocking a dependency, fixing a flaky test, or checking coverage."
---

# Testing Workflow

The project's test runner, its config and its commands are in the Project Context (Key Commands) and the skill bound to the **testing** slot; browser and E2E tests, in the skill bound to **e2e-testing**, and **browser-testing**.

## Test first

1. Write the test for the behaviour you are about to add or fix, and watch it fail, for the reason you expect. A test that has never failed proves nothing.
2. Write the least code that makes it pass.
3. Clean up with the test green.

A bug fix starts with a test that reproduces the bug.

## What to cover

- **Behaviour, not implementation:** inputs and outputs, what the user sees, what is stored. A refactor that keeps the behaviour keeps the tests green.
- **Past the happy path:** empty results, the boundaries, invalid input, a failing network or dependency, the same action twice.
- **That interactions change something:** assert that a control changes the result — not only that it renders — and assert the values, not a screenshot.
- **Coverage** at the threshold in the project's test config; integration tests at each boundary (API, database, URL state); E2E tests on the critical journeys.

## Mocks

Mock what you do not own — external APIs, the clock, randomness — at the boundary. Never mock the module under test, and never assert on a mock's own behaviour: that tests the mock.

## Flaky tests

No `sleep`: wait for the condition (`waitFor`, an assertion that polls). Reset state between tests. A test that fails one run in ten is a bug — fix it or delete it; never retry it into green.

## E2E in an agent session

One suite per session, at most three screenshots, a reload between flows, and the results in your answer: the suite, the counts, and each failure with its evidence.

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.