
experience-lwc-accessibility-jest-run
Use ALWAYS when running Sa11y accessibility Jest tests for an LWC — locally before pushing, producing the command(s), running one file vs a suite, selecting tests by naming convention, saving Sa11y-rendered HTML, or reproducing a Sa11y/A11yBug failure. Covers core (Bazel; bazel test // : ) and standalone npx jest (.accessibility.test.js, @sa11y/jest). REQUIRED for a run-plan.md, a failing a11y test's exit code, or SA11Y/A11yBug/core-Bazel test paths. DO NOT TRIGGER for functional Jest tests, a11y review without running tests (use experience-accessibility-validate), or Selenium-based a11y tests.
- Installs
- 908
- Last 24h
- +10
- Trending rank
- #8710
- Security
- Not audited
Install
Works with every agent the skills CLI supports.
npx skills add https://github.com/forcedotcom/sf-skills --skill experience-lwc-accessibility-jest-run- 01
Install
Run the command in your project. The CLI asks which agents to install for.
- 02
Describe the task
Ask your agent for something this skill covers. It loads experience-lwc-accessibility-jest-run automatically when relevant.
- 03
Review the result
The agent follows the SKILL.md steps, scripts and references bundled with the skill.
SKILL.md
The instructions your agent reads when the skill is triggered.
Running LWC Accessibility Jest Tests
Run Sa11y accessibility unit tests on Lightning Web Components in either:
- Core (Bazel) — when a
WORKSPACEfile is present. - Standalone (Jest) — when there's no
WORKSPACE.
Selenium-level reproductions, GUS A11yBug ingestion, and other internal
Salesforce-only flows are out of scope for this skill. For source-code-level
WCAG review without running tests, see experience-accessibility-validate.
When to Use This Skill
- User wants to run accessibility unit tests (Sa11y Jest) locally before pushing a fix.
- User has a known failing test file path (e.g. from an A11yBug's
Test_Names__c) and wants to target it directly. - User is iterating on an accessibility fix and needs the fastest pass/fail signal.
Prerequisites
- For Bazel Jest tests: a Salesforce core build environment (a
WORKSPACEfile is present). - For standalone Jest tests:
@sa11y/jestinstalled and configured.
Workflow
Choose the approach based on the environment. If this is not a Salesforce core build environment, do not mention the Core workflow.
Core (Bazel)
Use this mode when a WORKSPACE file is present. The base command is:
{coreRootPath}/tools/bazel test [TARGET] --test_output=streamed --test_env=SA11Y_AUTO=1 --test_env=SA11Y_ENABLE_DOM_MUTATION_OBSERVER=1
Replace {coreRootPath} with the Core repository root, {moduleName} with the
module name, and {relativePath} with the test file path without the .test.js
extension.
To discover targets and paths:
find {coreRootPath}/{moduleName} -name "*.test.js" -type f
{coreRootPath}/tools/bazel query "tests(//{moduleName}:*)"
Component tests typically live under
modules/{componentDir}/{componentName}/__tests__/.
Prefer a single-file target when the failing test path is known:
{coreRootPath}/tools/bazel test //{moduleName}:{relativePath} --test_output=streamed --test_env=SA11Y_AUTO=1 --test_env=SA11Y_ENABLE_DOM_MUTATION_OBSERVER=1
Run all Sa11y Jest tests in a module when a specific test is not known:
{coreRootPath}/tools/bazel test //{moduleName}:sa11y_jest_test --test_output=streamed --test_env=SA11Y_AUTO=1 --test_env=SA11Y_ENABLE_DOM_MUTATION_OBSERVER=1
Multiple module targets can be passed to the same command. To filter tests
within a module, add --test_arg=--testMatch="**/{modulePath}/**".
Useful options:
- Update snapshots:
--test_arg="--updateSnapshot" - Disable cached test results:
--cache_test_results=no - Save rendered HTML:
--test_env=SA11Y_ENABLE_RENDERED_DOM_SAVE=1 --test_env=SA11Y_RENDERED_DOM_SAVE_PATH=sfdc-test/unit/javascript/htdocs/sa11y/jest
Use sfdc-test/unit/javascript/htdocs/sa11y/jest as the rendered DOM save path
to avoid EPERM errors.
Standalone (Jest)
Use this mode when no WORKSPACE file is present. Run all accessibility tests:
Do not prepend SA11Y_* environment variables in standalone mode;
@sa11y/jest is activated through the project's Jest setup.
npm test -- --testMatch="**/*.accessibility.test.js"
Or target a specific file:
npm test -- src/components/MyComponent/__tests__/MyComponent.accessibility.test.js
Use the filename or path supplied by the user. When the named test is in the current directory, keep a bare filename bare instead of inventing a path.
Other useful options are --coverage, --updateSnapshot, --watch, and
--verbose. To target a named test, use
npm test -- --testNamePattern="MyComponent accessibility".
Ensure Jest uses a jsdom environment and loads the project's @sa11y/jest
setup file. Copy or adapt the bundled assets/jest.config.js template into
the project's Jest configuration, and copy assets/sa11y-jest-setup.js to
test/setup/sa11y-setup.js. If the project already has a Jest configuration,
merge the relevant settings instead of overwriting unrelated configuration.
The SA11Y_* variables shown above are for Core/Bazel only; the Bazel commands
already include them.
Response Scope
Answer only what the user asked. Emit the requested command or commands plus the relevant exit-code meaning. Do not add watch, coverage, snapshot-update, HTML-save, or other variants unless the user requests them.
Expected Exit Codes
- Bazel:
0means all tests passed,3means tests failed, and1means the build or command failed. - Jest:
0means all tests passed and1means tests failed or an error occurred.
Verification Checklist
- Sa11y Jest run completed with a clear pass/fail signal (exit 0 or 3 for Bazel; exit 0 or 1 for Jest).
- If snapshots were intentionally updated, the new snapshots are committed alongside the fix.
Troubleshooting
- Bazel test "not found" — the target path is off. Remember to drop the
.test.jsextension in{relativePath}. - HTML saving fails with EPERM — use the prescribed save path
sfdc-test/unit/javascript/htdocs/sa11y/jest. - Standalone tests do not run — verify the test naming pattern, Jest
configuration,
@sa11y/jestdependency, andjsdomenvironment.
FAQ
What does the experience-lwc-accessibility-jest-run skill do?
Use ALWAYS when running Sa11y accessibility Jest tests for an LWC — locally before pushing, producing the command(s), running one file vs a suite, selecting tests by naming convention, saving Sa11y-rendered HTML, or reproducing a Sa11y/A11yBug failure. Covers core (Bazel; bazel test // : ) and standalone npx jest (.accessibility.test.js, @sa11y/jest). REQUIRED for a run-plan.md, a failing a11y test's exit code, or SA11Y/A11yBug/core-Bazel test paths. DO NOT TRIGGER for functional Jest tests, a11y review without running tests (use experience-accessibility-validate), or Selenium-based a11y tests.
How do I install experience-lwc-accessibility-jest-run?
Run npx skills add https://github.com/forcedotcom/sf-skills --skill experience-lwc-accessibility-jest-run in your project. The skills CLI detects the agents you use and copies the skill into the right folder. For Claude Code you can also place the skill folder at ~/.claude/skills/experience-lwc-accessibility-jest-run/ (personal) or .claude/skills/experience-lwc-accessibility-jest-run/ (project).
Which AI agents can use experience-lwc-accessibility-jest-run?
Any agent that supports the open Agent Skills format (a folder with a SKILL.md file), including Claude Code, Codex, Cursor, GitHub Copilot, Gemini CLI, Windsurf, Cline, OpenCode and more.
Is experience-lwc-accessibility-jest-run safe to install?
No partner security audit is available yet. Skills can run commands and scripts, so read the SKILL.md and any bundled files before installing.
Who maintains experience-lwc-accessibility-jest-run?
It is published by forcedotcom in forcedotcom/sf-skills. It has 908 recorded installs.
More from forcedotcom/sf-skills
platform-apex-generate
forcedotcom/sf-skills
Primary Apex authoring skill for class generation, refactoring, and review. ALWAYS ACTIVATE when the user mentions Apex, .cls, triggers, or asks to create/refactor a class (service, selector, domain, batch, queueable, schedulable, invocable, DTO, utility, interface, abstract, exception, REST resource). Use this skill for requests involving SObject CRUD, mapping collections, fetching related records, scheduled jobs, batch jobs, trigger design, @AuraEnabled controllers, @RestResource endpoints, custom REST APIs, or code review of existing Apex.
platform-apex-test-generate
forcedotcom/sf-skills
Use to generate and validate Apex test classes with TestDataFactory patterns, bulk testing (251+ records), mocking, assertions, and disciplined test-fix loops. Use when creating Apex test classes (for triggers, services, controllers, batch jobs, queueables, and callouts), improving coverage, debugging or fixing failing Apex tests, or running test/coverage analysis. Triggers on Test.cls files, sf apex run test, coverage reports. Do NOT trigger for production Apex (use platform-apex-generate) or Jest/LWC tests.
platform-apex-test-run
forcedotcom/sf-skills
Apex test execution, coverage analysis, and test-fix loops with 120-point scoring. Use when the user runs Apex tests, checks code coverage, fixes failing tests, or touches Test.cls / Test.cls files. DO NOT TRIGGER when writing Apex production code (use platform-apex-generate), Agentforce agent testing (use agentforce-test), or Jest/LWC tests (use experience-lwc-generate).
platform-apex-logs-debug
forcedotcom/sf-skills
Salesforce debug log analysis and troubleshooting with 100-point scoring. TRIGGER when: user analyzes debug logs, hits governor limits, reads stack traces, or touches .log files from Salesforce orgs. DO NOT TRIGGER when: running Apex tests (use platform-apex-test-run), generating or fixing Apex code (use platform-apex-generate), or Agentforce session tracing (use agentforce-observe).
platform-soql-query
forcedotcom/sf-skills
Use when the user needs SOQL/SOSL authoring or optimization: natural-language-to-query generation, relationship queries, aggregates, query-plan/selectivity analysis, and performance or safety improvements. TRIGGER when the user writes, optimizes, or debugs SOQL/SOSL, touches .soql files, or asks about relationship queries, aggregates, or query performance. DO NOT TRIGGER for bulk data operations (use platform-data-manage), Apex DML logic (use platform-apex-generate), or report/dashboard queries.
platform-metadata-deploy
forcedotcom/sf-skills
Salesforce DevOps automation using sf CLI v2. TRIGGER when: user deploys metadata, validates a deploy or does a dry-run, deploys to a Production org, quick-deploys a validated job ID, ships/promotes to prod, creates/manages scratch orgs or sandboxes, sets up CI/CD pipelines, or troubleshoots deployment errors with sf project deploy. DO NOT TRIGGER when: writing Apex code, building LWC components (use experience-lwc-generate), creating metadata definitions (use platform-custom-object-generate), deleting metadata from an org (use platform-destructive-deploy), or querying org data (use platform-data-manage).
Popular testing & qa skills
tdd
mattpocock/skills
Test-driven development. Use when the user wants to build features or fix bugs test-first, mentions "red-green-refactor", or wants integration tests.
grilling
mattpocock/skills
Grill the user relentlessly about a plan, decision, or idea. Use when the user wants to stress-test their thinking, or uses any 'grill' trigger phrases.
migrate-to-shoehorn
mattpocock/skills
Migrate test files from as type assertions to @total-typescript/shoehorn. Use when user mentions shoehorn, wants to replace as in tests, or needs partial test data.
run-train
lllllllama/rigorpilot-skills
Rigor Train skill for deep learning research repositories. Use when a documented or selected training command should be run conservatively for startup verification, short-run verification, full kickoff, or resume, with command, config, seed, log, checkpoint, status, and metric evidence written to standardized trainoutputs/. Do not use for environment setup, exploratory sweeps, speculative idea implementation, or end-to-end orchestration.
test-driven-development
obra/superpowers
Use when implementing any feature or bugfix, before writing implementation code
finishing-a-development-branch
obra/superpowers
Use when implementation is complete, all tests pass, and you need to decide how to integrate the work