Test fixture library
Skill roronoazoroshao369/vibe-coding-os/skills/core/test-fixture-library
Reusable test fixtures in tests/fixtures/*.json with declarative schema. Generated test cases feed into injection counters, redactor, and validation gates.From its SKILL.md
npx -y skills add roronoazoroshao369/vibe-coding-os --skill test-fixture-libraryAssembled from the repository path, not quoted from the project. Check it against their README if it does not work.
One thing to look at
- 0 stars0 stars. Stars are a popularity signal and not a quality one, but at this level it is likely that nobody has read this closely except its author, and you would be relying on your own review.
SKILL.md
4.5 KB, ~1.0k tokens by cl100k_base, as published. Nobody here has run it
Skill: Test Fixture Library
Purpose
Centralize test data as JSON files in tests/fixtures/ so security and validation tests share input corpora, can be regenerated from a single source of truth, and are easy to extend without editing test scripts.
The fixture library solves three problems:
- Test duplication — same input string repeated across multiple test files
- Hard-coded inputs in scripts — making test changes require editing source
- No separation between data and assertions — coupling inputs to assertion logic
When to use
- Adding new test cases to the security regression suite
- Extending the redactor test corpus
- Building new validation gates that need fixture data
- Documenting known-bad inputs (canary corpus)
- Sharing test data across CLI + web UI tests
Do NOT use for:
- Ad-hoc one-off debugging (write inline)
- Tests that depend on filesystem state (use temp dirs)
- Performance benchmarks (use synthetic data generators)
Inputs
- A test scenario (e.g. "AWS key in postTool mode")
- Expected behavior (detect? redact? warn? allow?)
- Optional: severity, mode, allowlist reference
Workflow
- Choose the fixture type —
injection,redactor,validation, or a new type - Create or extend
tests/fixtures/<type>-test-cases.jsonwith new entries - Validate with
node scripts/test-fixture-library.mjs validate - Generate tests with
inject-testsorredact-teststo JSON - Consume the generated JSON from your test runner (e.g. via
JSON.parse) - Run the suite — your test will pick up the new case automatically
Example: Add a new redactor test case
cat >> tests/fixtures/redactor-test-cases.json << EOF
,{"id": "redact-006", "input": "ghp_NEWKEYHERE1234567890abc", "should_redact": true, "mode": "postPublish"}
EOF
node scripts/test-fixture-library.mjs validate
Example: Generate injection tests for a CI runner
node scripts/test-fixture-library.mjs inject-tests > /tmp/inject-tests.json
node -e "const cases = require('/tmp/inject-tests.json'); console.log(cases.length + ' cases loaded');"
Example: List available fixtures
node scripts/test-fixture-library.mjs list
Outputs
- Validated JSON fixture files in
tests/fixtures/ - Generated test case arrays for use in test runners
- CI-friendly exit codes (0 = valid, 1 = errors)
- Optional: auto-discovery of new fixture files via directory listing
Failure modes
- Missing
namefield — fixture won't be loadable; validator exits 1 - Case missing
id— can't reference individual cases; validator exits 1 - Empty input strings — some tests require non-empty input; validate input per use case
- Schema drift — when extending fixtures, ensure all consumers handle new fields
- Stale fixtures — fixtures should be reviewed quarterly; deleted test cases may break consumers
- Sensitive data in fixtures — fixture files are committed to git; use placeholders not real secrets
Verification checklist
- Fixture file has
name,type,version,description,cases[] - Every case has unique
idand requiredinputfield -
node scripts/test-fixture-library.mjs validateexits 0 - At least one consumer (test script, gate) reads from this fixture
- No real secrets — use allowlisted examples (AKIA_EXAMPLE_PLACEHOLDER, sk_test_PLACEHOLDER)
- Schema documented in fixture comment header
- PR adds both fixture entries AND consumer updates together
Cross-references
-
See
templates/test-fixture-template.json— JSON template for new fixture files -
See
tests/security/regression.mjs— primary consumer of injection fixtures -
See
scripts/validate-redact.mjs— primary consumer of redactor fixtures -
See
security/defense/patterns/canary-corpus.v1.json— canonical injection corpus -
See
skills/core/docs-author/SKILL.md— for documenting new fixture types
Review cadence
- Quarterly: audit all fixtures for staleness, sensitivity, coverage
- On new fixture type: extend
loadFixtures()and add tovalidateaction - On retire: mark obsolete cases with
"deprecated": truefield rather than deleting
What ships with it
Read from the repository
Just SKILL.md. No reference files, no scripts.