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
Adds
patch-package
as suggested in the issue this PR fixes. The goal is to allowwindow.CSS
to be mockednull
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:
postinstall
, what should it be instead?patches/color.unpatched.js
but perhaps there's a better waydist
files