Skip to content
This repository has been archived by the owner on Aug 19, 2022. It is now read-only.

Commit

Permalink
Update Infra #969 - Replace isparta with istanbul
Browse files Browse the repository at this point in the history
  • Loading branch information
blainekasten committed Dec 6, 2018
1 parent 2d0c791 commit 132232f
Show file tree
Hide file tree
Showing 5 changed files with 326 additions and 167 deletions.
2 changes: 1 addition & 1 deletion .eslintignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@ lib
es
coverage
examples/dist
node_modules
node_modules
18 changes: 18 additions & 0 deletions karma.conf.coverage.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,24 @@
module.exports = function(config) {
require('./karma.conf.js')(config);
config.set({
webpack: {
module: {
rules: config.webpack.module.rules.concat([
{
test: /\.js$/,
exclude: [/node_modules/],
use: {
loader: 'babel-loader',
options: {
plugins: ['istanbul']
}
}
}
])
}
},
reporters: config.reporters.concat(['coverage']),
plugins: config.plugins.concat(['karma-coverage']),
coverageReporter: {
reporters: [
{
Expand Down
23 changes: 1 addition & 22 deletions karma.conf.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,5 @@
const path = require('path');

// Note: If we switch to ESM version of babelified files, we'll likely need to
// update from the ancient isparta-loader. Likely we'll switch to:
// https://github.com/istanbuljs/babel-plugin-istanbul with a `test` BABEL_ENV
//
// https://github.com/FormidableLabs/radium/issues/969
process.env.BABEL_ENV = 'commonjs';

module.exports = function(config) {
Expand All @@ -31,19 +26,7 @@ module.exports = function(config) {
{
test: /\.js$/,
enforce: 'pre',
include: path.resolve('src/__tests__/'),
loader: 'babel-loader'
},
{
test: /\.js$/,
include: path.resolve('src/'),
enforce: 'pre',
exclude: /(__tests__|__mocks__)/,
loader: 'isparta-loader?babel-loader'
},
{
test: /\.js$/,
exclude: [/node_modules/],
loader: 'babel-loader'
},
{
Expand Down Expand Up @@ -87,19 +70,15 @@ module.exports = function(config) {
flags: ['--no-sandbox']
}
},
reporters: ['mocha', 'coverage'],
reporters: ['mocha'],
browserNoActivityTimeout: 60000,
plugins: [
'karma-chrome-launcher',
'karma-coverage',
'karma-mocha',
'karma-mocha-reporter',
'karma-sinon-chai',
'karma-webpack'
],
coverageReporter: {
type: 'text'
},
browserConsoleLogOptions: {
level: 'log',
format: '%b %T: %m',
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@
},
"devDependencies": {
"babel-eslint": "^7.1.1",
"babel-plugin-istanbul": "^5.1.0",
"caniuse-api": "^2.0.0",
"chai": "^3.5.0",
"color": "^1.0.3",
Expand All @@ -89,7 +90,6 @@
"express-http-proxy": "^0.11.0",
"flow-bin": "^0.53.1",
"inject-loader": "^3.0.1",
"isparta-loader": "^2.0.0",
"jsdom": "^12.0.0",
"jsdom-global": "^3.0.2",
"karma": "^3.0.0",
Expand Down
Loading

0 comments on commit 132232f

Please sign in to comment.