Skip to content
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

Specify version of node / npm needed to run tests #1502

Closed
verfriemelt-dot-org opened this issue Jul 28, 2018 · 7 comments · Fixed by #2790
Closed

Specify version of node / npm needed to run tests #1502

verfriemelt-dot-org opened this issue Jul 28, 2018 · 7 comments · Fixed by #2790

Comments

@verfriemelt-dot-org
Copy link

verfriemelt-dot-org commented Jul 28, 2018

when i try to run only a subset of the tests ( eg. the language im currently working on, described here: https://prismjs.com/test-suite.html ) i get this error:

easteregg@x12 ~/Coding/prism (master *) $ npm test -- --language=plsql
npm ERR! Error: ENOENT: no such file or directory, open '/home/easteregg/Coding/prism/node_modules/--language=plsql/package.json'
npm ERR! If you need help, you may report this *entire* log,
npm ERR! including the npm and node versions, at:
npm ERR!     <http://github.com/npm/npm/issues>

npm ERR! System Linux 4.17.6-towo.1-siduction-amd64
npm ERR! command "/usr/bin/node" "/usr/bin/npm" "test" "--" "--language=plsql"
npm ERR! cwd /home/easteregg/Coding/prism
npm ERR! node -v v8.11.2
npm ERR! npm -v 1.4.21
npm ERR! path /home/easteregg/Coding/prism/node_modules/--language=plsql/package.json
npm ERR! syscall open
npm ERR! code ENOENT
npm ERR! errno -2
npm ERR! 
npm ERR! Additional logging details can be found in:
npm ERR!     /home/easteregg/Coding/prism/npm-debug.log
npm ERR! not ok code 0

i can run all tests without any problems, but since my machine is a bit old, this takes over 3 min, which is a little cumbersome.

@RunDevelopment
Copy link
Member

RunDevelopment commented Jul 28, 2018

I can reproduce this error with neither the Prism master branch nor your fork on Windows 10.

Could this be a Linux specific problem?
What Linux distribution are you using?

Update:
I just made a VM with Ubuntu 18.04.1 LTS and again I cannot reproduce the error.

@verfriemelt-dot-org
Copy link
Author

debian unstable, nothing to fancy about it.
its quite rare that i use node at all, so there is no additional config done to the system with regards to node or npm

@RunDevelopment
Copy link
Member

You might want to give updating npm a try.
The current version 6.1.0. Your version seems to be 1.4.21.

@verfriemelt-dot-org
Copy link
Author

 $ npm test

> prismjs@1.15.0 test /home/easteregg/Coding/prism
> mocha tests/testrunner-tests.js && mocha tests/run.js



  The token stream transformer
    ✓ should handle all kinds of simple transformations
    ✓ should handle nested structures
    ✓ should strip empty tokens
[ ... ]

i noticed the output of the commands invoked and used the mocha module directly:

./node_modules/mocha/bin/mocha tests/run.js

when i invoke that script with the argument --languages=plsql i get the expected results.

as you pointed out, it might have something to do, with that old npm version shipped with debian sid.
it seems only newer versions pass off that argument.

@mAAdhaTTah
Copy link
Member

So is this still a valid issue or no?

@verfriemelt-dot-org
Copy link
Author

depends, i would suggest updating the documentation and stating the npm version supporting this feature

@mAAdhaTTah mAAdhaTTah changed the title running subset of tests is broken Specify version of node / npm needed to run tests Aug 19, 2018
@mAAdhaTTah
Copy link
Member

Updated title to match. Thanks for the suggestion!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants