Skip to content

Commit 3ef9353

Browse files
gaiety-dequedependabot[bot]straker
authored
fix: colorio.js patch mocking CSS (#4456)
Adds `patch-package` as suggested in the issue this PR fixes. The goal is to allow `window.CSS` to be mocked `null` in situations such as using JSdom. Tests cover a version that is patched and one that is unpatched to demonstrate the patch truly fixes the issue. fixes: #4400 --- **Developer Notes/Questions** for review: - Someone mentioned the patch step should _not_ be `postinstall`, what should it be instead? - For test coverage purposes it's useful to keep an unpatched version, currently this is done manually in `patches/color.unpatched.js` but perhaps there's a better way - It's a bit gross modifying so many pre-compiled `dist` files - Instead of a patch, we could pull in colorjs.io as a submodule and build it ourselves, unsure how to propagate that to consumers of axe-core however - Perhaps this is fine and I could document how to update the patch in the future --------- Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Steven Lambert <2433219+straker@users.noreply.github.com> Co-authored-by: gaiety-deque <gaiety-deque@users.noreply.github.com>
1 parent 23b43dc commit 3ef9353

File tree

10 files changed

+705
-41
lines changed

10 files changed

+705
-41
lines changed

.circleci/config.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,13 +61,14 @@ jobs:
6161
paths:
6262
- node_modules
6363

64-
# Build and cache axe.js
64+
# Build and cache built files
6565
build_unix:
6666
<<: *defaults
6767
<<: *unix_box
6868
steps:
6969
- checkout
7070
- <<: *restore_dependency_cache_unix
71+
- run: npm run prepare
7172
- run: npm run build
7273
- save_cache:
7374
key: v9-cache-build-<< pipeline.git.revision >>

.github/workflows/test.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ jobs:
1818
node-version: 20
1919
cache: 'npm'
2020
- run: npm ci
21+
- run: npm run prepare
2122
- run: npm run build
2223
- uses: actions/upload-artifact@v4
2324
with:

.gitignore

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,4 +28,3 @@ typings/axe-core/axe-core-tests.js
2828

2929
# doc
3030
doc/rule-descriptions.*.md
31-

eslint.config.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -185,6 +185,7 @@ module.exports = [
185185
ignores: [
186186
'**/node_modules/*',
187187
'**/tmp/*',
188+
'patches/*',
188189
'build/tasks/aria-supported.js',
189190
'doc/api/*',
190191
'doc/examples/jest_react/*.js',

0 commit comments

Comments
 (0)