Skip to content

Commit 78ea036

Browse files
committed
Updated .travis.yml to upload coverage after travis run.
Updated istanbul version so coverage is calculated correctly. Added npm script to upload code coverage to codecov.
1 parent ca2087c commit 78ea036

File tree

3 files changed

+13
-8
lines changed

3 files changed

+13
-8
lines changed

.travis.yml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,7 @@
33
- "7.7.1"
44
cache:
55
directories:
6-
- "node_modules"
6+
- "node_modules"
7+
install:
8+
- npm install
9+
- npm upload-coverage

package.json

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "vuejs-logger",
33
"author": "Justin Kames",
4-
"version": "1.10.2",
4+
"version": "1.1.3",
55
"description": "Vuejs-logger, provides customizable logging functionality for Vue.js.",
66
"main": "dist/index.js",
77
"repository": {
@@ -10,6 +10,7 @@
1010
},
1111
"scripts": {
1212
"test": "istanbul cover _mocha -- --compilers js:babel-core/register -R spec --debug",
13+
"upload-coverage": "codecov -t $CODECOV_TOKEN",
1314
"transpile": "node_modules/babel-cli/bin/babel.js src --out-dir dist && node_modules/uglify-js/bin/uglifyjs dist/logger.js -c -m -o dist/logger.js",
1415
"prepublish": "npm test && npm run transpile"
1516
},
@@ -26,7 +27,7 @@
2627
"babel-preset-es2015": "6.24.1",
2728
"chai": "4.1.0",
2829
"codecov": "2.2.0",
29-
"istanbul": "0.4.5",
30+
"istanbul": "1.1.0-alpha.1",
3031
"mocha": "3.4.2",
3132
"uglify": "0.1.5",
3233
"vue": "2.4.1"

test/logger.js

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
import chai from 'chai'
2-
const expect = chai.expect
32
import Vue from 'vue'
43
import VueLogger from '../src/logger'
4+
5+
const expect = chai.expect
56
const {print, validateOptions, initLoggerInstance, logLevels, install} = VueLogger()
67

78
describe('Logger.js', () => {
@@ -40,7 +41,7 @@ describe('Logger.js', () => {
4041
const options = {
4142
logLevel: 'foo'
4243
}
43-
expect(() => { install(() => {}, options) })
44+
expect(() => { install(Vue, options) })
4445
.to
4546
.throw(Error, 'Provided options for vuejs-logger are not valid.')
4647
})
@@ -49,7 +50,7 @@ describe('Logger.js', () => {
4950
const options = {
5051
logLevel: false
5152
}
52-
expect(() => { install(() => {}, options) })
53+
expect(() => { install(Vue, options) })
5354
.to
5455
.throw(Error, 'Provided options for vuejs-logger are not valid.')
5556
})
@@ -58,7 +59,7 @@ describe('Logger.js', () => {
5859
const options = {
5960
logLevel: undefined
6061
}
61-
expect(() => { install(() => {}, options) })
62+
expect(() => { install(Vue, options) })
6263
.to
6364
.throw(Error, 'Provided options for vuejs-logger are not valid.')
6465
})
@@ -67,7 +68,7 @@ describe('Logger.js', () => {
6768
const options = {
6869
logLevel: null
6970
}
70-
expect(() => { install(() => {}, options) })
71+
expect(() => { install(Vue, options) })
7172
.to
7273
.throw(Error, 'Provided options for vuejs-logger are not valid.')
7374
})

0 commit comments

Comments
 (0)