-
Notifications
You must be signed in to change notification settings - Fork 65
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
fix(cli): find axe-core when installed globally #232
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we could better solve this using Node's module lookup algorithm.
axe_core_file_path = require.resolve('axe-core')
This will return the nearest installed axe-core. It works both when installed globally and as a project dependency.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tests
Writing a proper test for this will be difficult. To actually reproduce the problem, we'd have to globally install the program and run it. Not really something that qualifies as a "unit test" IMO. Furthermore, we're using Node's algorithm now, which we already assume works (otherwise, nothing here would). Since the existing tests pass, and this is removing custom logic and replacing it with Node's |
See: #229
This issue only happens when installing
@axe-core/cli
globally.Reviewer checks
Required fields, to be filled out by PR reviewer(s)