From a6d0469d23d09570ea47b87835b6c82a4671b8b4 Mon Sep 17 00:00:00 2001 From: Dan Vanderkam Date: Tue, 27 Oct 2015 10:09:58 -0400 Subject: [PATCH] Pass --grep to mocha from the command line. --- DEVELOP.md | 6 ++++++ scripts/run-tests.sh | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/DEVELOP.md b/DEVELOP.md index 7436326..9a13888 100644 --- a/DEVELOP.md +++ b/DEVELOP.md @@ -28,6 +28,12 @@ To iterate on a unit test, run the `watch` command above and open in your browser. You can use the Mocha UI to run just a single test or suite. Or you can change `it` to `it.only` to do run just one test in code. +To run a single test from the command line, you can use: + + npm run test -- --grep highlight-series-background + +(Note the extra `--`.) + ### dygraphs style When making a change, please try to follow the style of the existing dygraphs code. This will make the review process go much more smoothly. diff --git a/scripts/run-tests.sh b/scripts/run-tests.sh index 4b1c77f..4bc0718 100755 --- a/scripts/run-tests.sh +++ b/scripts/run-tests.sh @@ -18,4 +18,4 @@ trap finish EXIT sleep 1 # Start the tests -mocha-phantomjs http://localhost:8081/auto_tests/runner.html +mocha-phantomjs http://localhost:8081/auto_tests/runner.html "$@" -- 2.7.4