Commit 3ef9353
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
10 files changed
Lines changed: 705 additions & 41 deletions
File tree
- .circleci
- .github/workflows
- patches
- test
- integration/full/patch
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
61 | 61 | | |
62 | 62 | | |
63 | 63 | | |
64 | | - | |
| 64 | + | |
65 | 65 | | |
66 | 66 | | |
67 | 67 | | |
68 | 68 | | |
69 | 69 | | |
70 | 70 | | |
| 71 | + | |
71 | 72 | | |
72 | 73 | | |
73 | 74 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
18 | 18 | | |
19 | 19 | | |
20 | 20 | | |
| 21 | + | |
21 | 22 | | |
22 | 23 | | |
23 | 24 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
28 | 28 | | |
29 | 29 | | |
30 | 30 | | |
31 | | - | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
185 | 185 | | |
186 | 186 | | |
187 | 187 | | |
| 188 | + | |
188 | 189 | | |
189 | 190 | | |
190 | 191 | | |
| |||
0 commit comments