The injectAxe command currently directly looks for the node_modules folder to get axe-core source code. This - however - makes it incompatible with Yarn Plug'n'Play, since it doesn't rely on node_modules.
I worked it around by overwriting the injectAxe command in this way:
In this way, the task (that runs in Node) handles the require logic, while the command (that runs in the browser) gets the source from the task and injects it. This would probably also solve https://github.com/component-driven/cypress-axe/issues/73, which is somewhat related.
Let me know if you think this solution makes sense to you. If so, I will open a PR.
The
injectAxe
command currently directly looks for thenode_modules
folder to getaxe-core
source code. This - however - makes it incompatible with Yarn Plug'n'Play, since it doesn't rely onnode_modules
.I worked it around by overwriting the
injectAxe
command in this way:And adding this task to my Cypress plugins:
In this way, the task (that runs in Node) handles the require logic, while the command (that runs in the browser) gets the source from the task and injects it. This would probably also solve https://github.com/component-driven/cypress-axe/issues/73, which is somewhat related.
Let me know if you think this solution makes sense to you. If so, I will open a PR.