Commit 6d6a090c authored by Robert Knight's avatar Robert Knight

Add make target to run karma tests with auto-watch enabled

This provides a convenient way to start Karma tests and auto-run
them when test files are changed.

Because the test files are incorporated into a Browserify bundle
by karma-browserify which watches files for changes via watchify(),
we can turn off Karma's own watching of the test files.

This fixes a problem where changing a test spec file would result
in Karma running all the tests twice, once after the test spec file
changed and then again afterwards due to the browserify bundle
being updated a second or two after the test spec file changes.
parent a4c6ca73
...@@ -38,8 +38,12 @@ module.exports = function(config) { ...@@ -38,8 +38,12 @@ module.exports = function(config) {
'test/bootstrap.js', 'test/bootstrap.js',
// Tests // Tests
'**/*-test.coffee', //
'**/*-test.js' // Karma watching is disabled for these files because they are
// bundled with karma-browserify which handles watching itself via
// watchify
{ pattern: '**/*-test.coffee', watched: false, included: true, served: true },
{ pattern: '**/*-test.js', watched: false, included: true, served: true }
], ],
// list of files to exclude // list of files to exclude
......
...@@ -45,7 +45,7 @@ ...@@ -45,7 +45,7 @@
"devDependencies": { "devDependencies": {
"chai": "^3.2.0", "chai": "^3.2.0",
"jscs": "^1.13.1", "jscs": "^1.13.1",
"karma": "^0.12.17", "karma": "^0.13.10",
"karma-browserify": "^3.0.3", "karma-browserify": "^3.0.3",
"karma-chai": "^0.1.0", "karma-chai": "^0.1.0",
"karma-cli": "0.0.4", "karma-cli": "0.0.4",
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment