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

Commit

Permalink
Clean up some testing framework stuff.
Browse files Browse the repository at this point in the history
Fix Firefox with babel-polyfill.
  • Loading branch information
timdorr committed Feb 5, 2016
1 parent 10e34d2 commit 1b1f3f6
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 17 deletions.
33 changes: 17 additions & 16 deletions karma.conf.js
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
var path = require('path');
var webpack = require('webpack');
'use strict'

const path = require('path')

module.exports = function (config) {

var runCoverage = process.env.COVERAGE === 'true';
let runCoverage = process.env.COVERAGE === 'true'

var coverageLoaders = [];
var coverageReporters = [];
let coverageLoaders = []
let coverageReporters = []

if (runCoverage) {
coverageLoaders.push({
Expand All @@ -15,7 +16,7 @@ module.exports = function (config) {
loader: 'isparta'
}),

coverageReporters.push('coverage');
coverageReporters.push('coverage')
}

config.set({
Expand All @@ -39,25 +40,25 @@ module.exports = function (config) {
module: {
preLoaders: [
{
loader: 'babel',
test: /\.js$/,
exclude: [
path.resolve('node_modules/')
],
loader: 'babel'
},
include: [
path.resolve('src/'),
path.resolve('test/')
]

}
].concat(coverageLoaders)
}
},

webpackServer: {
noInfo: true
},
webpackServer: {},

coverageReporter: {
reporters: [
{ type: 'text' },
{ type: 'json', subdir: 'browser-coverage', file: 'coverage.json' }
]
}
});
};
})
}
4 changes: 3 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
"build": "mkdir -p lib && babel ./src -d lib",
"lint": "eslint examples src test",
"test": "npm run lint && npm run test:node && npm run test:browser",
"test:node": "mocha --compilers js:babel-core/register --recursive ./test/node",
"test:node": "mocha --compilers js:babel-register --recursive ./test/node",
"test:browser": "karma start",
"test:cov": "npm run test:cov:browser && npm run test:cov:node && npm run test:cov:report",
"test:cov:node": "babel-node $(npm bin)/isparta cover $(npm bin)/_mocha report --dir ./coverage/node-coverage -- --recursive ./test/node",
Expand All @@ -41,8 +41,10 @@
"babel-core": "^6.2.1",
"babel-eslint": "^4.1.6",
"babel-loader": "^6.2.0",
"babel-polyfill": "^6.3.14",
"babel-preset-es2015": "^6.3.13",
"babel-preset-stage-1": "^6.3.13",
"babel-register": "^6.4.3",
"eslint": "^1.10.3",
"eslint-config-rackt": "^1.1.1",
"eslint-plugin-react": "^3.15.0",
Expand Down
2 changes: 2 additions & 0 deletions test/browser/index.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import 'babel-polyfill'

import { hashHistory, browserHistory } from 'react-router'
import createTests from '../createTests.js'

Expand Down

0 comments on commit 1b1f3f6

Please sign in to comment.