Skip to content

Commit e15672b

Browse files
author
Lionel Bijaoui
committed
Fix code coverage
- Code coverage is back ! - Update dependencies
1 parent 574ca9a commit e15672b

File tree

4 files changed

+28
-15
lines changed

4 files changed

+28
-15
lines changed

.eslintignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
11
dist/*.js
22
!.eslintrc.js
3+
tests/unit/coverage

babel.config.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
module.exports = {
22
presets: ["@vue/app"],
3-
plugins: ["lodash"]
3+
plugins: ["lodash", "istanbul"]
44
};

package.json

Lines changed: 15 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
"build:core": "cross-env VUE_APP_FULL_BUNDLE=false vue-cli-service build --no-clean --target lib --name vfg-core src/index.js --report",
1212
"build:full": "cross-env VUE_APP_FULL_BUNDLE=true vue-cli-service build --no-clean --target lib --name vfg src/index.js --report",
1313
"lint": "vue-cli-service lint",
14-
"test:unit": "vue-cli-service test:unit --include ./tests/unit/setup.js",
14+
"test:unit": "nyc vue-cli-service test:unit --include ./tests/unit/setup.js",
1515
"coverall": "cat ./test/unit/coverage/lcov.info | ./node_modules/coveralls/bin/coveralls.js",
1616
"changelog": "conventional-changelog -i CHANGELOG.md -s",
1717
"changelog:full": "conventional-changelog -i CHANGELOG.md -s -r 0",
@@ -56,15 +56,15 @@
5656
"license": "MIT",
5757
"dependencies": {},
5858
"devDependencies": {
59-
"@vue/cli-plugin-babel": "3.0.4",
60-
"@vue/cli-plugin-eslint": "3.0.4",
61-
"@vue/cli-plugin-unit-mocha": "3.0.4",
62-
"@vue/cli-service": "3.0.4",
63-
"@vue/eslint-config-prettier": "3.0.4",
59+
"@vue/cli-plugin-babel": "3.0.5",
60+
"@vue/cli-plugin-eslint": "3.0.5",
61+
"@vue/cli-plugin-unit-mocha": "3.0.5",
62+
"@vue/cli-service": "3.0.5",
63+
"@vue/eslint-config-prettier": "3.0.5",
6464
"@vue/test-utils": "1.0.0-beta.25",
65-
"babel-plugin-istanbul": "5.0.1",
65+
"babel-plugin-istanbul": "5.1.0",
6666
"babel-plugin-lodash": "3.3.4",
67-
"bumped": "0.10.10",
67+
"bumped": "0.10.11",
6868
"chai": "4.2.0",
6969
"cleave.js": "1.4.4",
7070
"conventional-changelog-cli": "2.0.5",
@@ -77,12 +77,12 @@
7777
"istanbul-instrumenter-loader": "3.0.1",
7878
"jquery": "3.3.1",
7979
"lodash-webpack-plugin": "0.11.5",
80-
"node-sass": "4.9.3",
80+
"node-sass": "4.9.4",
8181
"nouislider": "11.1.0",
82-
"nyc": "13.0.1",
82+
"nyc": "13.1.0",
8383
"pikaday": "1.7.0",
8484
"sass-loader": "7.1.0",
85-
"sinon": "6.3.5",
85+
"sinon": "7.0.0",
8686
"vue": "2.5.17",
8787
"vue-highlightjs": "1.3.3",
8888
"vue-markdown": "2.2.4",
@@ -203,7 +203,7 @@
203203
"arrowParens": "always"
204204
},
205205
"nyc": {
206-
"check-coverage": true,
206+
"check-coverage": false,
207207
"per-file": true,
208208
"include": [
209209
"src/**/*.{js,vue}"
@@ -216,10 +216,11 @@
216216
],
217217
"reporter": [
218218
"lcov",
219-
"text"
219+
"text",
220+
"text-summary"
220221
],
221222
"report-dir": "./tests/unit/coverage",
222-
"temp-directory": "./tests/unit/coverage/.nyc_output",
223+
"temp-dir": "./tests/unit/coverage/.nyc_output",
223224
"cache": true,
224225
"all": true
225226
},

vue.config.js

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,17 @@ module.exports = {
4747
}
4848
]);
4949
config.plugin("lodash").use(LodashModuleReplacementPlugin);
50+
} else if (process.env.NODE_ENV === "test") {
51+
config.devtool("eval");
52+
config.module
53+
.rule("istanbul")
54+
.test(/\.(js|vue)$/)
55+
.enforce("post")
56+
.include.add(path.resolve(__dirname, "/src"))
57+
.end()
58+
.use("istanbul-instrumenter-loader")
59+
.loader("istanbul-instrumenter-loader")
60+
.options({ esModules: true });
5061
} else {
5162
config.resolve.alias.set("vue-form-generator", path.resolve("src"));
5263
}

0 commit comments

Comments
 (0)