axe-core icon indicating copy to clipboard operation
axe-core copied to clipboard

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

Open WilcoFiers opened this issue 2 years ago • 1 comments

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 avatar Apr 04 '24 17:04 WilcoFiers

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

gaiety-deque avatar May 07 '24 18:05 gaiety-deque