Skip to content

Commit 78359e6

Browse files
taiontimdorr
authored andcommitted
Switch to babel-plugin-istanbul (#3701)
1 parent f0a7d14 commit 78359e6

File tree

4 files changed

+13
-13
lines changed

4 files changed

+13
-13
lines changed

.babelrc

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,10 @@
99
},
1010
"es": {
1111
"presets": ["es2015-loose-native-modules", "stage-1"]
12+
},
13+
"test": {
14+
"presets": ["es2015-loose", "stage-1"],
15+
"plugins": ["istanbul"]
1216
}
1317
}
1418
}

karma.conf.js

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
const path = require('path')
21
const webpack = require('webpack')
32
const projectName = require('./package').name
43

@@ -84,18 +83,13 @@ module.exports = config => {
8483
devtool: 'cheap-module-inline-source-map',
8584
module: {
8685
loaders: [
87-
{ test: /\.js$/, exclude: /node_modules/, loader: 'babel' },
88-
{
89-
test: /\.js$/,
90-
include: path.resolve('modules/'),
91-
exclude: /__tests__/,
92-
loader: 'isparta'
93-
}
86+
{ test: /\.js$/, exclude: /node_modules/, loader: 'babel' }
9487
]
9588
},
9689
plugins: [
9790
new webpack.DefinePlugin({
98-
'process.env.NODE_ENV': JSON.stringify('test')
91+
'process.env.NODE_ENV': JSON.stringify('test'),
92+
__DEV__: true
9993
})
10094
]
10195
},

package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,8 @@
2323
"lint": "eslint modules examples *.js",
2424
"start": "cross-env BABEL_ENV=cjs node examples/server.js",
2525
"test": "npm run lint && npm run test-node && npm run test-browser",
26-
"test-browser": "cross-env BABEL_ENV=cjs karma start",
27-
"test-node": "cross-env BABEL_ENV=cjs mocha --compilers js:babel-register tests.node.js"
26+
"test-browser": "cross-env NODE_ENV=test karma start",
27+
"test-node": "cross-env NODE_ENV=test mocha --compilers js:babel-register tests.node.js"
2828
},
2929
"authors": [
3030
"Ryan Florence",
@@ -48,6 +48,7 @@
4848
"babel-loader": "^6.2.4",
4949
"babel-plugin-add-module-exports": "^0.2.1",
5050
"babel-plugin-dev-expression": "^0.2.1",
51+
"babel-plugin-istanbul": "^1.0.3",
5152
"babel-preset-es2015": "^6.9.0",
5253
"babel-preset-es2015-loose": "^7.0.0",
5354
"babel-preset-es2015-loose-native-modules": "^1.0.0",
@@ -65,7 +66,6 @@
6566
"express": "^4.14.0",
6667
"express-urlrewrite": "^1.2.0",
6768
"gzip-size": "^3.0.0",
68-
"isparta-loader": "^2.0.0",
6969
"karma": "^1.1.2",
7070
"karma-browserstack-launcher": "^1.0.1",
7171
"karma-chrome-launcher": "^1.0.1",

tests.node.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,3 @@
1-
import './modules/__tests__/serverRendering-test'
1+
global.__DEV__ = true
2+
3+
require('./modules/__tests__/serverRendering-test')

0 commit comments

Comments
 (0)