You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently the cli tries to load axe.js from 3 different locations (in oder):
process.cwd()
process.cwd() node_modules
the cli's node_modules
The problem is that this makes it really hard to test. We were using fs-mock but then ran into a problem in node v20.5.0 that prevented fs-mock from working. So we converted our small use case from fs-mock to use tempy, but that required a small hack to allow passing in what the process.cwd was, and trying to mock out what the cli's node_modules was.
I think we should spend some time thinking about how to write the code to be more easily testable. Right now it requires the hack to define what the working directory and file directory is. It also is highly dependent on how the final code is built (/dist/src/lib), but changing our build process shouldn't break our code.
The text was updated successfully, but these errors were encountered:
Currently the cli tries to load axe.js from 3 different locations (in oder):
node_modules
node_modules
The problem is that this makes it really hard to test. We were using
fs-mock
but then ran into a problem in node v20.5.0 that prevented fs-mock from working. So we converted our small use case from fs-mock to use tempy, but that required a small hack to allow passing in what theprocess.cwd
was, and trying to mock out what the cli'snode_modules
was.I think we should spend some time thinking about how to write the code to be more easily testable. Right now it requires the hack to define what the working directory and file directory is. It also is highly dependent on how the final code is built (
/dist/src/lib
), but changing our build process shouldn't break our code.The text was updated successfully, but these errors were encountered: