testing
Skill86 starsChanged 4 days agoMITView on GitHub
Use when writing, changing, reviewing, or running unit, schematics, E2E, accessibility, or visual regression tests, and when verifying implementation changes.
194 other projects use a version of this.
Adopted by
Most recently taken up by
- mphaxise/gstack-port-for-codextheir own version, first seen Nov 29, 2026
- siberiacancode/agent-skillstheir own version, first seen Nov 29, 2026
- rshankras/claude-code-apple-skillstheir own version, first seen Nov 29, 2026
- microsoft/vs-solutionpersistencetheir own version, first seen Nov 29, 2026
- atstaeff/ai-agentstheir own version, first seen Nov 29, 2026
- rodri-oliveira-dev/agentic-engineering-skillstheir own version, first seen Nov 29, 2026
Used with
Projects with it also use bundle-dependency-prs, update-library-template and 10 more.
Other files people use alongside this one.
Files found in the same public projects as a version of this one, more often than they turn up anywhere else. Each project counts once, large collections count for less, and this file's own repository is left out.
MicrosoftSkillbundle-dependency-prs
Fix broken dependency update PRs and aggregate the ones that work into one PR.
Also in 8 projects that use this
MicrosoftSkillupdate-library-template
Merges the latest Library.Template into this repo (at position of HEAD) and resolves conflicts.
Also in 8 projects that use this
NVIDIA-NeMoSkillbuild-and-dependency
Dev environment setup for Megatron Bridge — container-based development, uv package management, lockfile regeneration, adding dependencies, Slurm container usage, and common build pitfalls.
Also in 3 projects that use this
timmo001Skillchangeset-scope
Keep all scoped code work contained to the user-defined changeset. Use for implementation, fixes, diagnosis, refactoring, cleanup, and review when explicit instructions, named files, diffs, branches, pull requests, or injected work scopes define the boundary.
Also in 3 projects that use this
JetBrainsSkillmodule-dependencies
Add or modify IntelliJ module dependencies in `.iml` files.
Also in 3 projects that use this
CES-LtdSkilloss-pr
Use when creating a pull request, after committing changes, or when user invokes /oss-pr. Covers branch management, quality checks, commit, push, and PR creation.
Also in 3 projects that use this
Other versions194 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 194
- modelcontextprotocol/servers★ 92ksame name
- lobehub/lobe-chat★ 86ksame name
- lobehub/lobehub★ 86ksame name
- penpot/penpot★ 63ksame name
- meteor/meteor★ 45ksame name
- iOfficeAI/AionUi★ 34ksame name
- garrytan/gbrain★ 34ksame name
- OpenZeppelin/openzeppelin-contracts★ 27ksame name
- tursodatabase/turso★ 25ksame name
- redis/go-redis★ 22ksame name
184 more not listed
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository6 other files it gives its agents.
- AGENTS.mdAGENTS.md
- gh-stackSkill
- git-githubSkill
- playwright-cliSkill
- reviewSkill
- elementSkill
The file
Show its rules and text
We split this skill into the rules it gives an agent
30 rules. 0 are common, 13 are distinctive, and 17 are very specific to this project.
0
Common
Most of the 175 edited versions we read keep these.
13
Distinctive
This author's own choices. Worth a look.
17
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 12
Test observable behavior through public APIs and the rendered DOM, not private methods or internal implementation details.
- Distinctive: line 15
Keep each test focused on a single behavior with clear arrange / act / assert phases.
- Very specific: line 24
Prefer creating the component directly with TestBed.
- Distinctive: line 27
Only introduce a test host / wrapper component when testing content projection, template composition, or integration behavior that cannot …
- Distinctive: line 30
Keep test setup minimal. Mock only the component's direct dependencies and prefer lightweight spies or stubs over large testing modules.
- Very specific: line 34
Prefer automatic cleanup of mocks and spies with using (for example, using spy = vi.spyOn(service, 'save')) so they are restored when the …
- Very specific: line 41
Never use fixture.detectChanges() in unit tests.
- Distinctive: line 47
Prefer assertions on user-observable behavior such as rendered text, attributes, ARIA state, CSS classes that are part of the public …
- Distinctive: line 49
Avoid tests that merely check whether a single attribute is set.
- Very specific: line 62
Prefer Vitest's semantic assertion matchers over generic .toBe() with manual property access — they produce clearer failure messages and …
- Very specific: line 64
Use await expect.element(locator).toBeInTheDocument() to check DOM presence, or .not.toBeInTheDocument() to check absence.
- Very specific: line 70
Use toHaveLength(n) instead of accessing .length manually: expect(items).toHaveLength(3), not expect(items.length).toBe(3).
- Very specific: line 72
Use toContain(item) instead of expect(array.includes(item)).toBe(true).
- Very specific: line 73
Use toMatchObject(subset) to assert on a subset of properties instead of multiple individual .toBe() assertions.
- Very specific: line 75
Do not assert on styles in unit tests.
- Distinctive: line 77
Do not add new unit tests for the change of a static values / style properties.
- Distinctive: line 83
Ensure that snapshots cover every distinct visual state affected by the change.
- Distinctive: line 84
Avoid repeating detailed functional scenarios that belong in unit tests.
- Very specific: line 85
After interactions such as clicking or typing, use an appropriate web-first assertion (await expect(...).to...()) to verify that the page …
- Distinctive: line 96
Use the Vitest commands below.
- Very specific: line 98
Always set CI=true when running unit tests.
- Very specific: line 123
Only the --include CLI flag (glob filter) is supported for the Angular test commands.
- Very specific: line 124
Do NOT use --watch, --no-watch, --watch=false, --reporter, or any other flags.
- Very specific: line 125
Use CI=true instead of watch flags.
- Very specific: line 129
Use ./e2e-local.sh to run E2E tests.
- Very specific: line 131
Do not read e2e-local.sh, assume everything is configured properly.
- Very specific: line 133
Check whether the required servers are already running before starting any.
- Distinctive: line 141
Only for dashboards tests, start the corresponding dashboard server if needed:
- Distinctive: line 148
Run E2E tests:
- Distinctive: line 167
Always include the project, unless explicitly all snapshots should be updated.
“Common” is measured: kept by at least 6 in 10 of the 175 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Testing
Test design and coverage
- Bug fixes and features must have corresponding tests that meaningfully exercise the changed behavior and would catch regressions.
- Test observable behavior through public APIs and the rendered DOM, not private methods or internal implementation details. Generally, do not test getters and setters directly.
- Keep each test focused on a single behavior with clear arrange / act / assert phases.
- Cover happy paths, boundary conditions, and regression-prone branches without testing every possible combination. For example, if Space and Enter perform the same action, verify that both work, but do not repeat every scenario with both keys.
Angular component tests
- Prefer creating the component directly with
TestBed. Use signalinputBindingandoutputBindingbindings instead of test host / wrapper components when wiring inputs and outputs. - Only introduce a test host / wrapper component when testing content projection, template composition, or integration behavior that cannot be expressed through direct bindings.
- Keep test setup minimal. Mock only the component's direct dependencies and prefer lightweight spies or stubs over large testing modules.
- In Vitest browser tests, prefer
pageanduserEventfor queries and interactions. - Prefer automatic cleanup of mocks and spies with
using(for example,using spy = vi.spyOn(service, 'save')) so they are restored when the block exits, even if the test fails. See Vitest's auto-cleanup withusing.
Async test stabilization
- Never use
fixture.detectChanges()in unit tests. Always useawait fixture.whenStable()to wait for Angular updates, including the initial render and updates after interactions or async state changes.
Assertions
- Prefer assertions on user-observable behavior such as rendered text, attributes, ARIA state, CSS classes that are part of the public contract, and emitted outputs.
Avoid tests that merely check whether a single attribute is set. Instead, use the attribute as part of an interaction or a meaningful behavioral assertion. For example:
// Avoid: checking only that the attribute exists. expect(element.querySelector('button')).toHaveAttribute('aria-label', 'Save'); // Prefer: finding the button by its accessible name and using it. await userEvent.click(page.getByRole('button', { name: 'Save', exact: true })); await expect.element(page.getByRole('status')).toHaveTextContent('Saved');- Prefer Vitest's semantic assertion matchers over generic
.toBe()with manual property access — they produce clearer failure messages and more readable tests. - Use
await expect.element(locator).toBeInTheDocument()to check DOM presence, or.not.toBeInTheDocument()to check absence. UsetoBeVisible()when visibility, rather than presence alone, is the requirement. - Scope browser queries to the component container with
page.elementLocator(fixture.nativeElement)and chain semantic locators from it. This keeps queries focused on the component rather than the whole document. - Use
toHaveLength(n)instead of accessing.lengthmanually:expect(items).toHaveLength(3), notexpect(items.length).toBe(3). - Use
toContain(item)instead ofexpect(array.includes(item)).toBe(true). - Use
toMatchObject(subset)to assert on a subset of properties instead of multiple individual.toBe()assertions. - Do not assert on styles in unit tests. Exception: they are calculated and dynamic like the position of an Element in response to a drag operation.
- Do not add new unit tests for the change of a static values / style properties.
E2E tests and visual regression
- Playwright E2E tests are relatively slow. Their primary purpose should be visual regression testing through snapshots, not exhaustive functional coverage.
- Ensure that snapshots cover every distinct visual state affected by the change. Avoid repeating detailed functional scenarios that belong in unit tests.
- After interactions such as clicking or typing, use an appropriate web-first
assertion (
await expect(...).to...()) to verify that the page has reached the expected state before taking a snapshot. Otherwise, the snapshot may be flaky.
Running tests
Infer the correct test command from the file path being edited. After implementation changes, run the matching unit test command to verify.
Unit tests
Use the Vitest commands below; do not invoke Karma/Jasmine.
Always set CI=true when running unit tests. This disables watch mode so tests run
once and configures browser tests to run headlessly.
Choose the most specific matching path prefix:
| File path prefix | Command |
projects/element-ng/schematics/ | CI=true npm run schematics:test |
projects/element-ng/ | CI=true pnpm lib:test |
projects/charts-ng/ | CI=true pnpm charts:test |
projects/native-charts-ng/ | CI=true pnpm native-charts:test |
projects/maps-ng/ | CI=true pnpm maps:test |
projects/dashboards-ng/ | CI=true pnpm dashboards:test |
projects/element-translate-ng/ | CI=true pnpm translate:test |
The schematics command runs Vitest directly with
projects/element-ng/vitest.config.schematics.ts. The other commands use Angular's
test runner with Vitest.
To run a specific test file with the Angular test commands, use --include:
CI=true pnpm lib:test --include='**/component-name/component-name.component.spec.ts'Only the --include CLI flag (glob filter) is supported for the Angular test commands.
Do NOT use --watch, --no-watch, --watch=false, --reporter, or any other flags.
Use CI=true instead of watch flags.
E2E tests
Use ./e2e-local.sh to run E2E tests. If you run a specific test, always include
--project=... in addition. Never run playwright tests directly.
Do not read e2e-local.sh, assume everything is configured properly.
Check whether the required servers are already running before starting any.
The live-preview demo app runs on http://localhost:4200/. If it is not online,
ask the user to start it; do not start it yourself. The command for the user is:
pnpm start --allowed-hosts true --host 0.0.0.0Only for dashboards tests, start the corresponding dashboard server if needed:
pnpm dashboards-demo:build-and-run-all # webpack, port 4201
pnpm dashboards-demo:build-and-run-all:esm # ESM, port 4204Run E2E tests:
./e2e-local.sh # run all
./e2e-local.sh run '--project=element-examples/*' # examples project
./e2e-local.sh run '--project=dashboards-demo/*' # dashboards-webpack project
./e2e-local.sh run '--project=dashboards-demo-esm/*' # dashboards-esm project
./e2e-local.sh vrt # visual regression only
./e2e-local.sh a11y # accessibility only
# Update snapshots
./e2e-local.sh update # changed snapshots
./e2e-local.sh update-all # all snapshots
./e2e-local.sh update <test-file-name> # specific test (glob supported)
# Run specific static tests (with the examples project selected)
./e2e-local.sh run static '--project=element-examples/*' --grep 'buttons/buttons|badges/badges'Always include the project, unless explicitly all snapshots should be updated.
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.

