-
Notifications
You must be signed in to change notification settings - Fork 780
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
On Node 10 and older, CLI can't find "qunit" if there's a "qunit.json" file #1484
Labels
Comments
I raised this upstream with Node because it seems to me like a bug.
|
Suggested workaround for now, until we drop Node 10 support: > process.versions.node
10.15.2
> require.resolve( "qunit", { paths: [ process.cwd() ] } )
'/eslint-config-wikimedia/qunit.json'
> require.resolve( "qunit", { paths: [ process.cwd() + '/node_modules', process.cwd() ] } )
'/eslint-config-wikimedia/node_modules/qunit/qunit/qunit.js' |
Krinkle
added a commit
that referenced
this issue
Sep 30, 2020
If the project using QUnit has a local qunit.json file in the repository root, then the CLI was unable to find the 'qunit' package. Instead, it first found a local 'qunit.json' file. This affected an ESLint plugin with a 'qunit' preset file. This bug was fixed in Node 12, and thus only affects Node 10 for us. The bug is also specific to require.resolve(). Regular use of require() was not affected and always correctly found the local package. (A local file would only be considered if the require started with dot-slash like `./qunit`.) Ref nodejs/node#35367. Fixes #1484.
Krinkle
added a commit
that referenced
this issue
Oct 3, 2020
If the project using QUnit has a local qunit.json file in the repository root, then the CLI was unable to find the 'qunit' package. Instead, it first found a local 'qunit.json' file. This affected an ESLint plugin with a 'qunit' preset file. This bug was fixed in Node 12, and thus only affects Node 10 for us. The bug is also specific to require.resolve(). Regular use of require() was not affected and always correctly found the local package. (A local file would only be considered if the require started with dot-slash like `./qunit`.) Ref nodejs/node#35367. Fixes #1484.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Tell us about your runtime:
What are you trying to do?
Running
qunit test/foo.js
vianpm test
from package.json.The project directory is a clone of https://github.com/wikimedia/eslint-config-wikimedia/.
What actually happened?
The QUnit CLI process fails early on due to confusing this file for the qunit package:
Manual inspection reveals that the
runner
variable received from https://github.com/qunitjs/qunit/blob/2.11.2/src/cli/require-qunit.js#L7 is in fact thequnit.json
file, and not thequnit
package.The text was updated successfully, but these errors were encountered: