Skip to content

Commit fb633b2

Browse files
fa93hwsplatinumazure
authored andcommittedOct 17, 2019
Chore: Add a script for testing with more control (#12444)
1 parent 012ec51 commit fb633b2

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed
 

‎docs/developer-guide/unit-tests.md

+5-1
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,10 @@ This automatically starts Mocha and runs all tests in the `tests` directory. You
1212

1313
If you want to quickly run just one test, you can do so by running Mocha directly and passing in the filename. For example:
1414

15-
./node_modules/.bin/mocha tests/lib/rules/no-wrap-func.js
15+
npm test:cli tests/lib/rules/no-wrap-func.js
1616

1717
Running individual tests is useful when you're working on a specific bug and iterating on the solution. You should be sure to run `npm test` before submitting a pull request.
18+
19+
## More Control on Unit Testing
20+
21+
`npm test:cli` is an alias of the Mocha cli in `./node_modules/.bin/mocha`. [Options](https://mochajs.org/#command-line-usage) are available to be provided to help to better control the test to run.

‎package.json

+1
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
"main": "./lib/api.js",
1010
"scripts": {
1111
"test": "node Makefile.js test",
12+
"test:cli": "mocha",
1213
"lint": "node Makefile.js lint",
1314
"fix": "node Makefile.js lint -- fix",
1415
"fuzz": "node Makefile.js fuzz",

0 commit comments

Comments
 (0)
Please sign in to comment.