Agent Skills › poteto/noodle › testing

testing

GitHub

Noodle项目的测试驱动开发工作流,涵盖编写测试、修复Bug、创建Fixtures及运行测试套件。强调先复现问题再编码,支持目录级Fixture和集成测试,提供完整命令参考以验证代码变更。

.agents/skills/testing/SKILL.md poteto/noodle

Trigger Scenarios

test write a test fix this bug add a fixture run tests TDD

Install

npx skills add poteto/noodle --skill testing -g -y
More Options

Non-standard path

npx skills add https://github.com/poteto/noodle/tree/main/.agents/skills/testing -g -y

Use without installing

npx skills use poteto/noodle@testing

指定 Agent (Claude Code)

npx skills add poteto/noodle --skill testing -a claude-code -g -y

安装 repo 全部 skill

npx skills add poteto/noodle --all -g -y

预览 repo 内 skill

npx skills add poteto/noodle --list

SKILL.md

Frontmatter
{
    "name": "testing",
    "description": "Test-driven development workflow for Noodle. Use when testing changes, writing tests, fixing bugs, creating fixtures, or running the test suite. Triggers: \"test\", \"write a test\", \"fix this bug\", \"add a fixture\", \"run tests\", \"TDD\", or any task involving verification of code changes."
}

Testing

Test-driven by default. Prove the problem before solving it.

Core Workflow: Bug First

  1. Reproduce — Run the failing scenario and observe the actual behavior
  2. Write a failing test — Minimal reproduction as a test case
  3. Commit the failing test — Use Skill(commit) with message like test: reproduce #issue-description
  4. Fix the code — Only now attempt the fix
  5. Verify — Run pnpm test and confirm the test passes
  6. Commit the fix — Separate commit from the test

This applies to all bug fixes. The failing test proves the bug exists and prevents regressions.

Fixture Tests

Noodle uses directory-based fixtures in testdata/. Read references/fixtures.md for full format, helper API, and code patterns.

Creating a New Fixture

./scripts/scaffold-fixture.sh <package-dir> <fixture-name> [state-count]

Fill in the generated input.json/input.ndjson and expected.md, then:

pnpm fixtures:hash:sync

Bug Fixtures

See references/fixtures.md for full bug fixture format (frontmatter fields, expected error sections, and the fix workflow).

Key Commands

Command Purpose
pnpm test Run all tests
pnpm test:short Skip integration tests
pnpm check Full local CI (test + vet + lint + fixtures)
pnpm bugs List fixtures marked as known bugs
pnpm fixtures:loop Verify loop fixtures match expected
pnpm fixtures:loop:record Regenerate loop fixture expected output
pnpm fixtures:hash Verify fixture input hashes
pnpm fixtures:hash:sync Update fixture input hashes
pnpm vet Run go vet
pnpm lint:arch Architecture lint (file sizes, legacy patterns)

Running Specific Tests

# Single package
go test ./loop

# Single test
go test ./loop -run TestLoopDirectoryFixtures

# Bypass cache
go test -count=1 ./parse

# With race detector
go test -race ./...

# Verbose
go test -v ./tui

Integration Tests

Long-running or external-dependency tests use testing.Short():

if testing.Short() {
    t.Skip("skipping integration test in short mode")
}

pnpm test:short skips these. pnpm test runs everything.

Version History

  • 82d2921 Current 2026-11-19 21:09

Same Skill Collection

.agents/skills/adversarial-review/SKILL.md
.agents/skills/ast-grep/SKILL.md
.agents/skills/brain/SKILL.md
.agents/skills/codex/SKILL.md
.agents/skills/commit/SKILL.md
.agents/skills/debugging/SKILL.md
.agents/skills/execute/SKILL.md
.agents/skills/find-skills/SKILL.md
.agents/skills/frontend-design/SKILL.md
.agents/skills/go-best-practices/SKILL.md
.agents/skills/interaction-design/SKILL.md
.agents/skills/make-interfaces-feel-better/SKILL.md
.agents/skills/meditate/SKILL.md
.agents/skills/noodle/SKILL.md
.agents/skills/oops/SKILL.md
.agents/skills/plan/SKILL.md
.agents/skills/quality/SKILL.md
.agents/skills/react-best-practices/SKILL.md
.agents/skills/refine/SKILL.md
.agents/skills/reflect/SKILL.md
.agents/skills/review/SKILL.md
.agents/skills/ruminate/SKILL.md
.agents/skills/schedule/SKILL.md
.agents/skills/skill-creator/SKILL.md
.agents/skills/todo/SKILL.md
.agents/skills/unslop/SKILL.md
.agents/skills/worktree/SKILL.md
examples/minimal/.agents/skills/execute/SKILL.md
examples/minimal/.agents/skills/schedule/SKILL.md
examples/multi-skill/.agents/skills/execute/SKILL.md
examples/multi-skill/.agents/skills/schedule/SKILL.md
skills/skill-creator/SKILL.md
.agents/skills/ts-best-practices/SKILL.md
examples/multi-skill/.agents/skills/deploy/SKILL.md
examples/multi-skill/.agents/skills/test/SKILL.md

Metadata

Files
0
Version
82d2921
Hash
38ed7bc2
Indexed
2026-11-19 21:09

inicio - Wiki
Copyright © 2011-2026 iteam. Current version is 2.156.0. UTC+08:00, 2026-11-19 22:01
浙ICP备14020137号-1