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

Commit e033f6f

Browse files
committed
Simple Karma config
1 parent c65645b commit e033f6f

File tree

3 files changed

+57
-4
lines changed

3 files changed

+57
-4
lines changed

Diff for: .babelrc

+3-2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
{
2-
"presets": ["es2015"]
3-
}
2+
"presets": ["es2015"],
3+
"plugins": ["transform-object-assign"]
4+
}

Diff for: karma.conf.js

+40
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
var path = require('path');
2+
var webpack = require('webpack');
3+
4+
module.exports = function (config) {
5+
6+
config.set({
7+
8+
browsers: [ 'Firefox' ],
9+
frameworks: [ 'mocha' ],
10+
reporters: [ 'mocha' ],
11+
12+
files: [
13+
'test/index.js'
14+
],
15+
16+
preprocessors: {
17+
'test/index.js': [ 'webpack', 'sourcemap' ]
18+
},
19+
20+
singleRun: true,
21+
22+
webpack: {
23+
devtool: 'inline-source-map',
24+
entry: path.join(__dirname, 'test', 'index.js'),
25+
module: {
26+
preLoaders: [
27+
{
28+
test: /\.js$/,
29+
exclude: /node_modules/,
30+
loader: 'babel'
31+
}
32+
]
33+
}
34+
},
35+
36+
webpackServer: {
37+
noInfo: true
38+
},
39+
});
40+
};

Diff for: package.json

+14-2
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,9 @@
1212
],
1313
"license": "MIT",
1414
"scripts": {
15-
"build": "mkdir -p lib && babel ./src/index.js --plugins transform-object-assign --out-file ./lib/index.js",
15+
"build": "mkdir -p lib && babel ./src/index.js --out-file ./lib/index.js",
1616
"test": "mocha --compilers js:babel-core/register --recursive",
17+
"test:browser": "karma start",
1718
"test:cov": "babel-node $(npm bin)/isparta cover $(npm bin)/_mocha -- --recursive",
1819
"prepublish": "npm run build"
1920
},
@@ -29,13 +30,24 @@
2930
"devDependencies": {
3031
"babel-cli": "^6.1.2",
3132
"babel-core": "^6.2.1",
33+
"babel-loader": "^6.2.0",
3234
"babel-plugin-transform-object-assign": "^6.0.14",
3335
"babel-preset-es2015": "^6.1.2",
3436
"expect": "^1.13.0",
3537
"history": "^1.13.1",
3638
"isparta": "^4.0.0",
39+
"karma": "^0.13.3",
40+
"karma-chrome-launcher": "^0.2.0",
41+
"karma-firefox-launcher": "^0.1.7",
42+
"karma-ie-launcher": "^0.2.0",
43+
"karma-mocha": "^0.2.0",
44+
"karma-mocha-reporter": "^1.0.4",
45+
"karma-safari-launcher": "^0.1.1",
46+
"karma-sourcemap-loader": "^0.3.5",
47+
"karma-webpack": "^1.7.0",
3748
"mocha": "^2.3.4",
38-
"redux": "^3.0.4"
49+
"redux": "^3.0.4",
50+
"webpack": "^1.12.9"
3951
},
4052
"dependencies": {
4153
"deep-equal": "^1.0.1"

0 commit comments

Comments
 (0)