一键导入
testing
TDD/BDD testing principles. Use when writing tests, reviewing test coverage, setting up testing, or discussing test strategy and test architecture.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
TDD/BDD testing principles. Use when writing tests, reviewing test coverage, setting up testing, or discussing test strategy and test architecture.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
Docker & Hadolint validation (2026). Use when working with Docker, containers, or validating Dockerfiles.
Security guidelines and OWASP Top 10. Use when reviewing security, implementing authentication or authorization, hardening code, or discussing vulnerabilities.
Third-party Claude Code token/context/code-review tools. Use when choosing or recommending an external tool to reduce token usage, manage context, or review large codebases (caveman, code-review-graph, token-savior, context-mode...).
Third-party Claude Code token/context/code-review tools. Use when choosing or recommending an external tool to reduce token usage, manage context, or review large codebases.
Testing Flutter 3.44 / BLoC v9 / Riverpod 3 - Stratégie Complète. Use when writing tests, reviewing test coverage, or setting up testing.
Testing React Native 0.85+. Use when writing tests, reviewing test coverage, or setting up testing.
| name | testing |
| description | TDD/BDD testing principles. Use when writing tests, reviewing test coverage, setting up testing, or discussing test strategy and test architecture. |
| context | fork |
| triggers | {"files":["**/tests/**","**/test/**","**/__tests__/**","**/spec/**","*.test.*","*.spec.*","*Test*.*","*_test.*"],"keywords":["test","coverage","TDD","BDD","mock","assert","unit test","integration test","e2e","end-to-end","fixture","factory","arrange act assert","given when then","red green refactor","test pyramid","mutation testing","property-based testing"]} |
| auto_suggest | true |
Principes universels de testing pour toutes les technologies du framework Claude-Craft.
| Stack | Unit/Composants | E2E/Browser | Mutation Testing |
|---|---|---|---|
| JS/TS/React | Vitest 4.1+ (Browser Mode stable) | Playwright | Stryker |
| PHP/Laravel/Symfony | Pest 4.5+ (PHPUnit 12, Browser Testing) | Playwright via Pest | Infection |
| Python | pytest 8.x + Ruff 0.8+ | Playwright | Mutmut |
| Flutter | flutter_test + bloc_test 10+ | Patrol 3.13+ | built-in |
| React Native | RNTL + Jest | Detox/Maestro | Stryker |
Sources : Vitest 4, Pest 4, Stryker Mutator
Abandonner JSDOM lourd. Chromium/Firefox/WebKit natifs.
// vitest.config.ts
export default defineConfig({
test: {
browser: {
enabled: true,
name: 'chromium', // ou 'firefox', 'webkit'
provider: 'playwright',
},
},
});
Source : Vitest Browser Mode
Tester la qualité des tests. Mutation score >= 80%.
# Stryker (JS/TS/C#)
npx stryker run
# Infection (PHP)
vendor/bin/infection --min-msi=80
# Mutmut (Python)
mutmut run
Source : Stryker Mutator
Générer des tests à partir de propriétés invariantes.
// fast-check (JS/TS)
import fc from 'fast-check';
test('sorting preserves all elements', () => {
fc.assert(
fc.property(fc.array(fc.integer()), (arr) => {
const sorted = [...arr].sort();
return sorted.length === arr.length;
})
);
});
Source : fast-check
// Pest 4.5+ avec Playwright natif
test('user can login', function () {
$this->browse(function (Browser $browser) {
$browser->visit('/login')
->type('email', 'alice@example.com')
->type('password', 'secret')
->press('Login')
->assertPathIs('/dashboard');
});
});
Source : Pest 4 Browser Testing
// vitest.workspace.ts
export default defineWorkspace([
'packages/*/vitest.config.ts', // Unit tests
{
test: {
browser: { enabled: true, name: 'chromium' },
include: ['e2e/**/*.test.ts'],
},
}, // Browser tests
]);
Source : Vitest Workspaces
Voir @.claude/references/base/testing.md pour documentation complète.