This repository was archived by the owner on Jun 14, 2018. It is now read-only.
File tree Expand file tree Collapse file tree 4 files changed +22
-18
lines changed
Expand file tree Collapse file tree 4 files changed +22
-18
lines changed Original file line number Diff line number Diff line change 11{
22 "presets" : [" es2015" , " stage-2" ],
33 "plugins" : [" transform-runtime" ],
4- "comments" : false
4+ "comments" : false ,
5+ "env" : {
6+ "test" : {
7+ "plugins" : [ " istanbul" ]
8+ }
9+ }
510}
Original file line number Diff line number Diff line change @@ -40,13 +40,17 @@ module.exports = {
4040 {
4141 test : / \. v u e $ / ,
4242 loader : 'eslint' ,
43- include : projectRoot ,
43+ include : [
44+ path . join ( projectRoot , 'src' )
45+ ] ,
4446 exclude : / n o d e _ m o d u l e s /
4547 } ,
4648 {
4749 test : / \. j s $ / ,
4850 loader : 'eslint' ,
49- include : projectRoot ,
51+ include : [
52+ path . join ( projectRoot , 'src' )
53+ ] ,
5054 exclude : / n o d e _ m o d u l e s /
5155 }
5256 ] ,
@@ -59,7 +63,9 @@ module.exports = {
5963 {
6064 test : / \. j s $ / ,
6165 loader : 'babel' ,
62- include : projectRoot ,
66+ include : [
67+ path . join ( projectRoot , 'src' )
68+ ] ,
6369 exclude : / n o d e _ m o d u l e s /
6470 } ,
6571 {
Original file line number Diff line number Diff line change 77 "scripts" : {
88 "dev" : " node build/dev-server.js" ,
99 "build" : " node build/build.js" {{#unit }},
10- "unit" : " karma start test/unit/karma.conf.js --single-run" {{/unit }}{{#e2e }},
10+ "unit" : " cross-env BABEL_ENV=test karma start test/unit/karma.conf.js --single-run" {{/unit }}{{#e2e }},
1111 "e2e" : " node test/e2e/runner.js" {{/e2e }}{{#if_or unit e2e }},
1212 "test" : " {{#unit}}npm run unit{{/unit}}{{#unit}}{{#e2e}} && {{/e2e}}{{/unit}}{{#e2e}}npm run e2e{{/e2e}}" {{/if_or }}{{#lint }},
1313 "lint" : " eslint --ext .js,.vue src{{#unit}} test/unit/specs{{/unit}}{{#e2e}} test/e2e/specs{{/e2e}}" {{/lint }}
5555 "http-proxy-middleware" : " ^0.17.2" ,
5656 "json-loader" : " ^0.5.4" ,
5757 {{#unit }}
58+ "cross-env" : " ^3.1.3" ,
5859 "karma" : " ^1.3.0" ,
5960 "karma-coverage" : " ^1.1.1" ,
6061 "karma-mocha" : " ^1.2.0" ,
6970 "sinon" : " ^1.17.3" ,
7071 "sinon-chai" : " ^2.8.0" ,
7172 "inject-loader" : " ^2.0.1" ,
72- "isparta-loader " : " ^2 .0.0" ,
73+ "babel-plugin-istanbul " : " ^3 .0.0" ,
7374 "phantomjs-prebuilt" : " ^2.1.3" ,
7475 {{/unit }}
7576 {{#e2e }}
Original file line number Diff line number Diff line change @@ -18,7 +18,7 @@ var webpackConfig = merge(baseConfig, {
1818 devtool : '#inline-source-map' ,
1919 vue : {
2020 loaders : {
21- js : 'isparta '
21+ js : 'babel-loader '
2222 }
2323 } ,
2424 plugins : [
@@ -31,18 +31,10 @@ var webpackConfig = merge(baseConfig, {
3131// no need for app entry during tests
3232delete webpackConfig . entry { { #if_eq lintConfig "airbnb" } } ; { { / i f _ e q } }
3333
34- // make sure isparta loader is applied before eslint
35- webpackConfig . module . preLoaders = webpackConfig . module . preLoaders || [ ] { { #if_eq lintConfig "airbnb" } } ; { { / i f _ e q } }
36- webpackConfig . module . preLoaders . unshift ( {
37- test : / \. j s $ / ,
38- loader : 'isparta' ,
39- include : path . resolve ( projectRoot , 'src' ) { { #if_eq lintConfig "airbnb" } } , { { / i f _ e q } }
40- } ) { { #if_eq lintConfig "airbnb" } } ; { { / i f _ e q } }
41-
42- // only apply babel for test files when using isparta
34+ // Use babel for test files too
4335webpackConfig . module . loaders . some ( function ( loader , i ) {
44- if ( loader . loader === 'babel' ) {
45- loader . include = path . resolve ( projectRoot , 'test/unit' ) { { #if_eq lintConfig "airbnb" } } ; { { / i f _ e q } }
36+ if ( / ^ b a b e l ( - l o a d e r ) ? $ / . test ( loader . loader ) ) {
37+ loader . include . push ( path . resolve ( projectRoot , 'test/unit' ) ) { { #if_eq lintConfig "airbnb" } } ; { { / i f _ e q } }
4638 return true { { #if_eq lintConfig "airbnb" } } ; { { / i f _ e q } }
4739 }
4840} ) { { #if_eq lintConfig "airbnb" } } ; { { / i f _ e q } }
You can’t perform that action at this time.
0 commit comments