Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Test Commands for Windows #499

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

Closed
NotAdrian wants to merge 2 commits into oauthjs:dev from NotAdrian:dev
Closed

Test Commands for Windows #499

NotAdrian wants to merge 2 commits into oauthjs:dev from NotAdrian:dev

Conversation

@NotAdrian
Copy link

@NotAdrian NotAdrian commented Jun 4, 2018

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 reacted with thumbs up emoji
Copy link

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

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

"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

@thomseddon thomseddon Aug 3, 2018

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

Copy link

@peter-fan-cn peter-fan-cn May 27, 2019

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

@thomseddon thomseddon Aug 3, 2018

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

Copy link
Member

maxtruxa commented May 28, 2019
edited
Loading

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. 🙃

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

Reviewers

@thomseddon thomseddon thomseddon requested changes

+1 more reviewer

@peter-fan-cn peter-fan-cn peter-fan-cn left review comments

Reviewers whose approvals may not affect merge requirements

Assignees

No one assigned

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

AltStyle によって変換されたページ (->オリジナル) /