Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Don't break on window.CSS === null #4400

Open
WilcoFiers opened this issue Apr 4, 2024 · 1 comment · May be fixed by #4456
Open

Don't break on window.CSS === null #4400

WilcoFiers opened this issue Apr 4, 2024 · 1 comment · May be fixed by #4456
Assignees
Labels
dependencies Pull requests that update a dependency file fix Bug fixes support
Milestone

Comments

@WilcoFiers
Copy link
Contributor

WilcoFiers commented Apr 4, 2024

Angular + Jest documentation recommends a solution which ends up setting window.CSS to null. This creates an issue when axe-core imports colorjs, which has a falsey check for window.CSS, but when null errors out.

Since ColorJS didn't accept our patch, we'll try to use patch-package to fix the issue ourselves. We'll need some tests to go along with that to confirm our solution continues to work after updating ColorJS.

patch-package should probably run in the build step, not as a post-install.

@WilcoFiers WilcoFiers added fix Bug fixes dependencies Pull requests that update a dependency file labels Apr 4, 2024
@WilcoFiers WilcoFiers added this to the Axe-core 4.10 milestone Apr 4, 2024
@gaiety-deque
Copy link
Contributor

gaiety-deque commented May 7, 2024

Just for full context, window.CSS is no longer recommended in the Jest for Angular docs (thanks Michael) thymikee/jest-preset-angular@ac30648 which is live on their docs site https://thymikee.github.io/jest-preset-angular/docs/getting-started/installation/#global-mocks

gaiety-deque added a commit that referenced this issue May 9, 2024
patching colorio.js with optional chaining for `CSS?.supports`

Refs: #4400
@gaiety-deque gaiety-deque linked a pull request May 10, 2024 that will close this issue
gaiety-deque added a commit that referenced this issue May 14, 2024
patching colorio.js with optional chaining for `CSS?.supports`

Refs: #4400
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
dependencies Pull requests that update a dependency file fix Bug fixes support
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants