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.
--- /dev/null
+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'
+ ]
+ });
+};
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,
"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",