Use phantomjs when running a single test

This commit is contained in:
Richard van der Hoff 2016-03-28 23:29:49 +01:00
parent 5f3b82a767
commit 04561ea6e6
2 changed files with 20 additions and 15 deletions

View file

@ -1,16 +1,20 @@
// karma.conf.js // karma.conf.js - the config file for karma, which runs our tests.
var webpack = require('webpack'); var webpack = require('webpack');
var path = require('path'); var path = require('path');
/* /*
* It's a pain to have to wait for webpack to build everything; however it's * We use webpack to build our tests. It's a pain to have to wait for webpack
* the easiest way to load our dependencies from node_modules. * to build everything; however it's the easiest way to load our dependencies
* from node_modules.
* *
* TODO: * TODO:
* - can we run one test at a time * - can we run one test at a time
* - can we can we run under phantomjs/jsdom?
* - write junit out * - write junit out
*/ */
process.env.PHANTOMJS_BIN = 'node_modules/.bin/phantomjs';
module.exports = function (config) { module.exports = function (config) {
config.set({ config.set({
// frameworks to use // frameworks to use

View file

@ -18,7 +18,7 @@
"start": "babel src -w -d lib --source-maps", "start": "babel src -w -d lib --source-maps",
"clean": "rimraf lib", "clean": "rimraf lib",
"prepublish": "npm run build; git rev-parse HEAD > git-revision.txt", "prepublish": "npm run build; git rev-parse HEAD > git-revision.txt",
"test": "karma start", "test": "karma start --browsers PhantomJS",
"test-multi": "karma start --single-run=false" "test-multi": "karma start --single-run=false"
}, },
"dependencies": { "dependencies": {
@ -44,18 +44,19 @@
"//depsbuglink": "https://github.com/webpack/webpack/issues/1472", "//depsbuglink": "https://github.com/webpack/webpack/issues/1472",
"devDependencies": { "devDependencies": {
"babel": "^5.8.23", "babel": "^5.8.23",
"expect": "^1.16.0",
"json-loader": "^0.5.3", "json-loader": "^0.5.3",
"karma": "^0.13.22",
"karma-chrome-launcher": "^0.2.3",
"karma-cli": "^0.1.2",
"karma-mocha": "^0.2.2",
"karma-phantomjs-launcher": "^1.0.0",
"karma-sourcemap-loader": "^0.3.7",
"karma-webpack": "^1.7.0",
"mocha": "^2.4.5",
"phantomjs-prebuilt": "^2.1.7",
"require-json": "0.0.1", "require-json": "0.0.1",
"rimraf": "^2.4.3", "rimraf": "^2.4.3",
"source-map-loader": "^0.1.5", "source-map-loader": "^0.1.5"
"karma": "^0.0.0",
"karma-cli": "^0.0.0",
"karma-mocha": "^0.0.0",
"karma-webpack": "^0.0.0",
"karma-sourcemap-loader": "^0.0.0",
"karma-chrome-launcher": "^0.0.0",
"mocha": "^0.0.0",
"expect": "^0.0.0"
} }
} }