authoring-tests
Skill115 starsChanged 55 days agoApache-2.0View on GitHub
Write and run automated tests for Elements components including unit, accessibility, visual, SSR, and lighthouse tests. Use this skill whenever the user wants to write, create, update, or debug test files (.test.ts, .test.axe.ts, .test.visual.ts, .test.ssr.ts, .test.lighthouse.ts). Also trigger when the user asks about createFixture, removeFixture, elementIsStable, emulateClick, untilEvent, runAxe, visual baselines, theme testing, or test structure patterns like describe block naming.
In this repository46 other files it gives its agents.
- AGENTS.mdAGENTS.md
- projects/starters/angular/AGENTS.mdAGENTS.md
- projects/starters/bundles/AGENTS.mdAGENTS.md
- projects/starters/eleventy/AGENTS.mdAGENTS.md
- projects/starters/eleventy-ssr/AGENTS.mdAGENTS.md
- projects/starters/go/AGENTS.mdAGENTS.md
- projects/starters/go-htmx/AGENTS.mdAGENTS.md
- projects/starters/hugo/AGENTS.mdAGENTS.md
- projects/starters/importmaps/AGENTS.mdAGENTS.md
- projects/starters/lit-library/AGENTS.mdAGENTS.md
- projects/starters/mcp-app/AGENTS.mdAGENTS.md
- projects/starters/mpa/AGENTS.mdAGENTS.md
- projects/starters/nextjs/AGENTS.mdAGENTS.md
- projects/starters/nuxt/AGENTS.mdAGENTS.md
- projects/starters/react/AGENTS.mdAGENTS.md
- projects/starters/solidjs/AGENTS.mdAGENTS.md
- projects/starters/sphinx/AGENTS.mdAGENTS.md
- projects/starters/svelte/AGENTS.mdAGENTS.md
- projects/starters/typescript/AGENTS.mdAGENTS.md
- projects/starters/vue/AGENTS.mdAGENTS.md
- agent-availability-reportSkill
- agent-debug-ciSkill
- agent-dependenciesSkill
- agent-startersSkill
- agent-upkeepSkill
- agent-web-modernizationSkill
- audit-accessibilitySkill
- audit-ciSkill
- audit-codeSkill
- audit-consolidationSkill
- audit-simplificationSkill
- authoring-benchmarksSkill
- authoring-componentsSkill
- authoring-documentationSkill
- authoring-examplesSkill
- authoring-patternsSkill
- authoring-projectsSkill
- authoring-typescriptSkill
- elementsSkill
- github-dependabotSkill
- guidance-api-designSkill
- guidance-buildSkill
- guidance-webgpu-performanceSkill
- summarize-releasesSkill
- summarize-video-releasesSkill
- troubleshootingSkill
The file
We split this skill into the rules it gives an agent
9 rules. About 0 are common, 2 are distinctive, and 7 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈2
Distinctive · estimate
This author's own choices. Worth a look.
7
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 20
Read the specific guideline based on the test type you're working with:
- Very specific: line 22
Unit Tests (
.test.ts): Read testing-unit.md - covers createFixture, elementIsStable, event testing - Very specific: line 23
Accessibility Tests (
.test.axe.ts): Read testing-accessibility.md - covers axe-core usage, WCAG compliance - Very specific: line 24
Visual Tests (
.test.visual.ts): Read testing-visual.md - covers Playwright screenshots, theme testing - Very specific: line 25
SSR Tests (
.test.ssr.ts): Read testing-ssr.md - covers server-side rendering compatibility - Very specific: line 26
Lighthouse Tests (
.test.lighthouse.ts): Read testing-lighthouse.md - covers performance, accessibility scores - Very specific: line 31
Wait for Stability: Always use elementIsStable() before making assertions on Lit components
- Distinctive: line 32
Comprehensive Coverage: All new components require unit, accessibility, and visual tests at minimum
- Very specific: line 33
Real User Events: Use emulateClick and untilEvent for realistic event testing
≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Authoring Tests
You MUST review @projects/site/src/docs/internal/guidelines/testing.md before making any testing changes.
When to Use This Skill
- Creating new test files for components (
.test.ts,.test.axe.ts,.test.visual.ts,.test.ssr.ts,.test.lighthouse.ts) - Debugging test failures or updating existing tests
- Understanding testing utilities from
@internals/testing - Setting up test configurations or HTML templates
- Writing tests that follow project patterns
Test Type Guidelines
Read the specific guideline based on the test type you're working with:
- Unit Tests (
.test.ts): Read testing-unit.md - coverscreateFixture,elementIsStable, event testing - Accessibility Tests (
.test.axe.ts): Read testing-accessibility.md - covers axe-core usage, WCAG compliance - Visual Tests (
.test.visual.ts): Read testing-visual.md - covers Playwright screenshots, theme testing - SSR Tests (
.test.ssr.ts): Read testing-ssr.md - covers server-side rendering compatibility - Lighthouse Tests (
.test.lighthouse.ts): Read testing-lighthouse.md - covers performance, accessibility scores
Key Principles
- Test Isolation: Each test should be independent with proper setup/teardown using
createFixtureandremoveFixture - Wait for Stability: Always use
elementIsStable()before making assertions on Lit components - Comprehensive Coverage: All new components require unit, accessibility, and visual tests at minimum
- Real User Events: Use
emulateClickanduntilEventfor realistic event testing - Theme Testing: Visual tests should cover both light and dark themes
References
- Testing Overview
- Unit Testing
- Accessibility Testing
- Lighthouse Testing
- SSR Testing
- Visual Testing
- Vite Internals
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

