Skip to content

Commit

Permalink
Replace pa11y with underlying HTML_CodeSniffer (#285)
Browse files Browse the repository at this point in the history
* Replace pa11y with underlying HTML_CodeSniffer

**Why**:

- It currently duplicates and sometimes conflicts with our integration testing setup
   - Currently, we run two separate versions of Puppeteer, which each download separate copies of Chromium
   - Also helps me to avoid debugging a vague error occurring when upgrading dependencies to latest version
- Consolidates testing tools to Jest
- A step toward alignment of accessibility integration testing, as it could be reasonably substituted with aXe
- Easier to run individual tests, which was difficult before since Jest setup occurred through scripts/jest.sh and did not support additional arguments. Now, test commands can go directly through the Jest CLI.
- Fewer dependencies overall

* Remove deleted accessibility job

* Swap test-jest npm script with test

* Remove unused pa11y configuration file
aduth authored Jan 25, 2022

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
1 parent b65183b commit a9b3275
Showing 11 changed files with 64 additions and 1,726 deletions.
20 changes: 2 additions & 18 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -67,7 +67,7 @@ jobs:
- build
- run:
name: Run jest integration test
command: npm run test-jest
command: npm test
visual-regression:
working_directory: ~/identity-style-guide
executor: ruby_browsers
@@ -79,22 +79,7 @@ jobs:
- build
- run:
name: Run visual regression test
command: npm run test-jest
- store_artifacts:
path: tmp/results
destination: results
- store_test_results:
path: tmp/results
accessibility:
working_directory: ~/identity-style-guide
executor: ruby_browsers
steps:
- checkout
- bundle-npm-install
- build
- run:
name: Run pa11y accessibility test
command: npm run test-pa11y
command: npm test
- store_artifacts:
path: tmp/results
destination: results
@@ -108,4 +93,3 @@ workflows:
- lints
- integration
- visual-regression
- accessibility
9 changes: 0 additions & 9 deletions .pa11yci.js

This file was deleted.

10 changes: 1 addition & 9 deletions Makefile
Original file line number Diff line number Diff line change
@@ -61,15 +61,7 @@ copy-scss:
./node_modules/.bin/gulp copy-scss

test: build
make test-runners

test-runners: test-runner-pa11y test-runner-jest

test-runner-pa11y:
./scripts/pa11y.sh

test-runner-jest:
./scripts/jest.sh
npm exec jest

clean:
rm -rf $(OUTPUT_DIR)
2 changes: 2 additions & 0 deletions jest-puppeteer.config.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
process.env.JEST_PORT = process.env.JEST_PORT || '40410';

module.exports = {
server: {
command: `ruby -run -ehttpd ./dist -p${process.env.JEST_PORT}`,
Loading

0 comments on commit a9b3275

Please sign in to comment.