From fb0c917a70badf5ac4e4638fb941782d6e34b6a1 Mon Sep 17 00:00:00 2001 From: Peter Bacon Darwin Date: Fri, 28 Mar 2014 12:08:30 +0000 Subject: [PATCH] docs(README): npm test watches files for changes --- README.md | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 1089492523..73475bd9ef 100644 --- a/README.md +++ b/README.md @@ -105,13 +105,17 @@ The easiest way to run the unit tests is to use the supplied npm script: npm test ``` -This script will start the Karma test runner to execute the unit tests. +This script will start the Karma test runner to execute the unit tests. Moreover, Karma will sit and +watch the source and test files for changes and then re-run the tests whenever any of them change. +This is the recommended strategy; if you unit tests are being run every time you save a file then +you receive instant feedback on any changes that break the expected code functionality. -We can also have Karma sit and watch the application and test files for changes and re-run the -tests whenever any of them change. You can do this with: +You can also ask Karma to do a single run of the tests and then exit. This is useful if you want to +check that a particular version of the code is operating as expected. The project contains a +predefined script to do this: ``` -npm run test-watch +npm run test-single-run ```