.claude/skills/ln-743-test-infrastructure/SKILL.md
Creates test infrastructure with Vitest, xUnit, and pytest
npx skillsauth add cbbkrd-tech/jl-finishes ln-743-test-infrastructureInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Paths: File paths (
shared/,references/,../ln-*) are relative to skills repo root. If not found at CWD, locate this SKILL.md directory and go up one level for repo root.
Type: L3 Worker Category: 7XX Project Bootstrap Parent: ln-740-quality-setup
Sets up testing frameworks, coverage tools, and sample tests for projects.
Does:
Does NOT:
| Technology | Test Framework | Coverage Tool | Config File |
|------------|---------------|---------------|-------------|
| TypeScript/React | Vitest | v8/Istanbul | vitest.config.ts |
| .NET | xUnit | Coverlet | *.Tests.csproj |
| Python | pytest | pytest-cov | pytest.ini or pyproject.toml |
Before creating test infrastructure, check what exists.
Files to Check:
| Stack | Test Indicators |
|-------|-----------------|
| TypeScript | vitest.config.*, jest.config.*, *.test.ts, *.spec.ts |
| .NET | *.Tests.csproj, *.IntegrationTests.csproj |
| Python | pytest.ini, conftest.py, tests/, test_*.py |
Decision Logic:
Create vitest.config.ts:
Dependencies:
npm install -D vitest @vitest/coverage-v8 @testing-library/react @testing-library/jest-dom jsdom
Create test project:
dotnet new xunit -n {Project}.Tests
dotnet sln add tests/{Project}.Tests
Dependencies (in .csproj):
Add to pyproject.toml or create pytest.ini:
Dependencies:
pip install pytest pytest-cov pytest-asyncio
# OR with uv:
uv add --dev pytest pytest-cov pytest-asyncio
src/
├── components/
│ ├── Button.tsx
│ └── Button.test.tsx # Co-located tests
├── test/
│ └── setup.ts # Test setup file
tests/
├── {Project}.Tests/
│ ├── Controllers/
│ │ └── SampleControllerTests.cs
│ ├── Services/
│ └── {Project}.Tests.csproj
└── {Project}.IntegrationTests/ # Optional
tests/
├── __init__.py
├── conftest.py # Fixtures
├── unit/
│ └── test_sample.py
└── integration/ # Optional
Create one sample test per stack demonstrating:
Shows:
Shows:
Shows:
After setup, verify tests work.
TypeScript:
npm test
npm run test:coverage
Expected: Sample test passes, coverage report generated
.NET:
dotnet test
dotnet test --collect:"XPlat Code Coverage"
Expected: Sample test passes, coverage collected
Python:
pytest
pytest --cov=src --cov-report=term-missing
Expected: Sample test passes, coverage report shown
On Failure: Check test configuration, dependencies, verify sample test syntax.
| Metric | Minimum | Target | |--------|---------|--------| | Lines | 70% | 80% | | Branches | 70% | 80% | | Functions | 70% | 80% | | Statements | 70% | 80% |
Configure CI to fail if coverage drops below thresholds.
RULE 1: Coverage thresholds MUST be configured. No exceptions.
RULE 2: Sample tests MUST pass. Don't create broken examples.
RULE 3: Use AAA pattern (Arrange-Act-Assert) in all sample tests.
RULE 4: Co-locate unit tests with source (TypeScript) or use tests/ directory (.NET, Python).
npm test / dotnet test / pytest runs successfully| File | Purpose | |------|---------| | vitest_template.ts | Vitest config template | | vitest_setup_template.ts | Test setup file | | react_test_template.tsx | React component test | | xunit_csproj_template.xml | .NET test project | | xunit_test_template.cs | xUnit test example | | pytest_config_template.toml | pytest config | | pytest_test_template.py | pytest test example | | testing_guide.md | Testing best practices |
| Error | Cause | Resolution |
|-------|-------|------------|
| Vitest not found | Not installed | npm install -D vitest |
| jsdom errors | Missing dependency | npm install -D jsdom |
| xUnit discovery fails | SDK version mismatch | Update Microsoft.NET.Test.Sdk |
| pytest not found | Not in PATH | pip install pytest |
| Coverage 0% | Wrong source path | Check coverage.include config |
Version: 2.0.0 Last Updated: 2026-01-10
testing
When the user wants to plan a content strategy, decide what content to create, or figure out what topics to cover. Also use when the user mentions "content strategy," "what should I write about," "content ideas," "blog strategy," "topic clusters," or "content planning." For writing individual pieces, see copywriting. For SEO-specific audits, see seo-audit.
development
When the user wants to create competitor comparison or alternative pages for SEO and sales enablement. Also use when the user mentions 'alternative page,' 'vs page,' 'competitor comparison,' 'comparison page,' '[Product] vs [Product],' '[Product] alternative,' or 'competitive landing pages.' Covers four formats: singular alternative, plural alternatives, you vs competitor, and competitor vs competitor. Emphasizes deep research, modular content architecture, and varied section types beyond feature tables.
development
Write B2B cold emails and follow-up sequences that get replies. Use when the user wants to write cold outreach emails, prospecting emails, cold email campaigns, sales development emails, or SDR emails. Covers subject lines, opening lines, body copy, CTAs, personalization, and multi-touch follow-up sequences.
development
When the user wants to reduce churn, build cancellation flows, set up save offers, recover failed payments, or implement retention strategies. Also use when the user mentions 'churn,' 'cancel flow,' 'offboarding,' 'save offer,' 'dunning,' 'failed payment recovery,' 'win-back,' 'retention,' 'exit survey,' 'pause subscription,' or 'involuntary churn.' This skill covers voluntary churn (cancel flows, save offers, exit surveys) and involuntary churn (dunning, payment recovery). For post-cancel win-back email sequences, see email-sequence. For in-app upgrade paywalls, see paywall-upgrade-cro.