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

build: Streamline mocha config #1905

Merged
merged 2 commits into from
May 2, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 7 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,13 +26,16 @@
"google storage",
"storage"
],
"mocha": {
Copy link
Contributor

Choose a reason for hiding this comment

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

What does moving this here vs the command line provide?

Copy link
Contributor

Choose a reason for hiding this comment

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

What does moving this here vs the command line provide?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It allows 2 things:

  • npx mocha <path-to-test(s)> without additional flags to type/remember
  • Easier IDE integration - IDEs no long require additional config in order to run mocha tests (which can change over time)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Add, if mocha is globally installed (npm i -g mocha) simply typing mocha in the CLI will run the default tests (same as npx mocha)

"require": "ts-node/register",
"extension": "ts"
},
"scripts": {
"predocs": "npm run compile",
"docs": "jsdoc -c .jsdoc.js",
"mocha": "mocha --require ts-node/register --extension ts",
"system-test": "npm run mocha -- system-test --timeout 600000 --exit",
"conformance-test": "npm run mocha -- --parallel --require conformance-test/globalHooks.ts conformance-test/",
"test": "c8 npm run mocha -- test",
"system-test": "mocha system-test --timeout 600000 --exit",
"conformance-test": "mocha --parallel --require ts-node/register --require conformance-test/globalHooks.ts conformance-test/",
"test": "c8 mocha test",
"lint": "gts check",
"samples-test": "npm link && cd samples/ && npm link ../ && npm test && cd ../",
"all-test": "npm test && npm run system-test && npm run samples-test",
Expand Down