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

Test Commands for Windows #499

Closed
wants to merge 2 commits into from
Closed

Test Commands for Windows #499

wants to merge 2 commits into from

Conversation

NotAdrian
Copy link

Hey there,

I've just came across the fact that the npm test and npm run test-debug commands ain't working on a Windows Operating System and here is my Suggestion.

Greetings
Not Adrian

@Namburgesas
Copy link

Looks great. I had to do roughly the same thing to test on my Windows machine.

@thomseddon
Copy link
Member

Looks good, I've added a couple of reviews. Please could you address and then squash into a single commit

Copy link
Member

@thomseddon thomseddon left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviews as mentioned

@@ -56,7 +56,9 @@
"scripts": {
"pretest": "./node_modules/.bin/jshint --config ./.jshintrc lib test",
"test": "NODE_ENV=test ./node_modules/.bin/mocha 'test/**/*_test.js'",
"test-debug": "NODE_ENV=test ./node_modules/.bin/mocha --inspect --debug-brk 'test/**/*_test.js'"
"test-windows": "set NODE_ENV=test&& node node_modules/mocha/bin/_mocha \"test\\**\\*_test.js\"",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Will this work with a space before the &&? If so, please add one

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

cross-env NODE_ENV=test ./node_modules/.bin/mocha --inspect --debug-brk 'test/**/*_test.js'

suggestion cross-env

"test-debug": "NODE_ENV=test ./node_modules/.bin/mocha --inspect --debug-brk 'test/**/*_test.js'"
"test-windows": "set NODE_ENV=test&& node node_modules/mocha/bin/_mocha \"test\\**\\*_test.js\"",
"test-debug": "NODE_ENV=test ./node_modules/.bin/mocha --inspect --debug-brk 'test/**/*_test.js'",
"test-windows-debug": "set NODE_ENV=test&& node node_modules/mocha/bin/_mocha --inspect --debug-brk \"test\\**\\*_test.js\""
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same as above, if this works with a space before the &&, please add one

@maxtruxa
Copy link
Member

maxtruxa commented May 28, 2019

Two suggestions that might make it possible to have just a single test command for all platforms:

  1. npx mocha should work the same on all platforms. I can't test it right now because of the lack of a Windows machine.
  2. Setting NODE_ENV could be done as shown here.

So the test commands might just look like this:

{
  "test": "npx mocha 'test/**/*_test.js'",
  "test-debug": "npx mocha --inspect --debug-brk 'test/**/*_test.js'"
}

Edit: NVM, 5.0 has more or less exactly this. 🙃

@thomseddon thomseddon closed this Jan 28, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants