Skip to content
This repository has been archived by the owner on Oct 26, 2018. It is now read-only.

Commit

Permalink
Simple Karma config
Browse files Browse the repository at this point in the history
  • Loading branch information
ellbee committed Nov 27, 2015
1 parent 0941951 commit 351ba9e
Show file tree
Hide file tree
Showing 3 changed files with 62 additions and 2 deletions.
2 changes: 1 addition & 1 deletion .babelrc
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
"presets": ["es2015"]
}
}
48 changes: 48 additions & 0 deletions karma.conf.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
var path = require('path');
var webpack = require('webpack');

module.exports = function (config) {

// To specify browsers to test against use BROWSER var and comma separated list:
// BROWSER=Firefox,Chrome,Safari,IE npm run test:browser
var browsers = process.env.BROWSER ? process.env.BROWSER.split(',') : [ 'Firefox' ];

config.set({

browsers: browsers,
frameworks: [ 'mocha' ],
reporters: [ 'mocha' ],

files: [
'test/index.js'
],

preprocessors: {
'test/index.js': [ 'webpack', 'sourcemap' ]
},

singleRun: true,

webpack: {
devtool: 'inline-source-map',
entry: path.join(__dirname, 'test', 'index.js'),
module: {
preLoaders: [
{
test: /\.js$/,
exclude: /node_modules/,
loader: 'babel',
query: {
presets: ['es2015'],
plugins: ['transform-object-assign']
}
}
]
}
},

webpackServer: {
noInfo: true
},
});
};
14 changes: 13 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
"scripts": {
"build": "mkdir -p lib && babel ./src/index.js --plugins transform-object-assign --out-file ./lib/index.js",
"test": "mocha --compilers js:babel-core/register --recursive",
"test:browser": "karma start",
"test:cov": "babel-node $(npm bin)/isparta cover $(npm bin)/_mocha -- --recursive",
"prepublish": "npm run build"
},
Expand All @@ -29,12 +30,23 @@
"devDependencies": {
"babel-cli": "^6.1.2",
"babel-core": "^6.2.1",
"babel-loader": "^6.2.0",
"babel-plugin-transform-object-assign": "^6.0.14",
"babel-preset-es2015": "^6.1.2",
"expect": "^1.13.0",
"history": "^1.13.1",
"isparta": "^4.0.0",
"karma": "^0.13.3",
"karma-chrome-launcher": "^0.2.0",
"karma-firefox-launcher": "^0.1.7",
"karma-ie-launcher": "^0.2.0",
"karma-mocha": "^0.2.0",
"karma-mocha-reporter": "^1.0.4",
"karma-safari-launcher": "^0.1.1",
"karma-sourcemap-loader": "^0.3.5",
"karma-webpack": "^1.7.0",
"mocha": "^2.3.4",
"redux": "^3.0.4"
"redux": "^3.0.4",
"webpack": "^1.12.9"
}
}

0 comments on commit 351ba9e

Please sign in to comment.