Fork off Karma file for in-browser debug
authorDan Vanderkam <danvdk@gmail.com>
Tue, 21 Apr 2015 18:41:06 +0000 (14:41 -0400)
committerDan Vanderkam <danvdk@gmail.com>
Tue, 21 Apr 2015 18:41:06 +0000 (14:41 -0400)
DEVELOP.md
auto_tests/chrome.karma.conf.js [new file with mode: 0644]
auto_tests/karma.conf.js
package.json

index 71bf785..8ddf024 100644 (file)
@@ -16,9 +16,9 @@ To run the tests, run:
 
 To iterate on the code, open `tests/demo.html` (or one of the other demos) in your browser.
 
-To iterate on a unit test, change `it` to `it.only` in the Mocha test, change the browser from `PhantomJS` to `Chrome` (or whatever you like) and set `singleRun` to `false` in `auto_tests/karma.conf.js`. Then run
+To iterate on a unit test, change `it` to `it.only` in the Mocha test. Then run
 
-    ./node_modules/karma/bin/karma start auto_tests/karma.conf.js
+    ./node_modules/karma/bin/karma start auto_tests/chrome.karma.conf.js
 
 and hit "DEBUG" in the Karma UI.
 
diff --git a/auto_tests/chrome.karma.conf.js b/auto_tests/chrome.karma.conf.js
new file mode 100644 (file)
index 0000000..9cd6039
--- /dev/null
@@ -0,0 +1,27 @@
+module.exports = function (config) {
+    config.set({
+        basePath: '../',
+        frameworks: [
+          'mocha',
+          'chai'
+        ],
+        files: [
+            'dist/dygraph-combined-dev.js',
+            'src/extras/smooth-plotter.js',
+            'auto_tests/data/*.js',
+            'auto_tests/tests/*.js',
+        ],
+        autoWatch: true,
+        singleRun: false,
+        reporters: ['mocha'],  // or 'dots', 'mocha', 'spec'
+        browsers: ['Chrome'],  // or 'Firefox', 'Safari', etc.
+        plugins: [
+            'karma-mocha',
+            'karma-chai-plugins',
+            'karma-chrome-launcher',
+            'karma-firefox-launcher',
+            'karma-spec-reporter',
+            'karma-mocha-reporter'
+        ]
+    });
+};
index 591643c..606c571 100644 (file)
@@ -8,7 +8,8 @@ module.exports = function (config) {
         files: [
             'dist/dygraph-combined-dev.js',
             'src/extras/smooth-plotter.js',
-            'auto_tests/**/*.js',
+            'auto_tests/data/*.js',
+            'auto_tests/tests/*.js',
         ],
         autoWatch: false,
         singleRun: true,
index e8d7388..cbe5638 100644 (file)
@@ -43,6 +43,7 @@
     "karma-chai-plugins": "^0.2.4",
     "karma-chrome-launcher": "^0.1.7",
     "karma-coverage": "^0.2.7",
+    "karma-firefox-launcher": "^0.1.4",
     "karma-mocha": "^0.1.10",
     "karma-mocha-reporter": "^1.0.2",
     "karma-phantomjs-launcher": "^0.1.4",