Last active
December 4, 2020 01:20
-
-
Save infojunkie/d69662419c42ea6c6b700fa929a19ba3 to your computer and use it in GitHub Desktop.
Running specific tests using mocha from a package.json script
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
"scripts": { | |
"test": "mocha --grep /${TEST:-'.*'}/i", | |
}, |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Call as
TEST=keyword npm test
or justnpm test
to run all tests.keyword
is matched case-insensitively.