Skip to content

Commit 176c310

Browse files
authored
Housekeeping (#113)
* Bump deps * remove unused dep * use testdouble instead of chai-spy
1 parent e3bcda7 commit 176c310

File tree

4 files changed

+3586
-30
lines changed

4 files changed

+3586
-30
lines changed

build/build.js

+3-4
Original file line numberDiff line numberDiff line change
@@ -79,10 +79,9 @@ function buildEntry (config) {
7979
return rollup.rollup(config).then(bundle => {
8080
const code = bundle.generate(config).code
8181
if (isProd) {
82-
var minified = (config.banner ? config.banner + '\n' : '') + uglify.minify(code, {
83-
fromString: true,
82+
var minified = uglify.minify(code, {
8483
output: {
85-
screw_ie8: true
84+
preamble: config.banner
8685
}
8786
}).code
8887
return write(config.dest, minified, true)
@@ -123,4 +122,4 @@ function logError (e) {
123122

124123
function blue (str) {
125124
return '\x1b[1m\x1b[34m' + str + '\x1b[39m\x1b[22m'
126-
}
125+
}

package.json

+18-19
Original file line numberDiff line numberDiff line change
@@ -35,27 +35,26 @@
3535
},
3636
"homepage": "https://github.com/vuejs/vue-class-component#readme",
3737
"devDependencies": {
38-
"@types/chai": "^3.4.35",
39-
"@types/mocha": "^2.2.40",
40-
"babel-core": "^6.24.0",
41-
"babel-loader": "^6.4.1",
42-
"babel-plugin-transform-class-properties": "^6.23.0",
38+
"@types/chai": "^4.0.1",
39+
"@types/mocha": "^2.2.41",
40+
"babel-core": "^6.25.0",
41+
"babel-loader": "^7.1.1",
42+
"babel-plugin-transform-class-properties": "^6.24.1",
4343
"babel-plugin-transform-decorators-legacy": "^1.3.4",
44-
"babel-preset-es2015": "^6.24.0",
45-
"chai": "^3.5.0",
46-
"chai-spies": "^0.7.1",
47-
"css-loader": "^0.27.3",
48-
"mocha": "^3.2.0",
49-
"node-libs-browser": "^2.0.0",
44+
"babel-preset-es2015": "^6.24.1",
45+
"chai": "^4.0.2",
46+
"css-loader": "^0.28.4",
47+
"mocha": "^3.4.2",
5048
"rimraf": "^2.6.1",
51-
"rollup": "^0.41.6",
49+
"rollup": "^0.43.0",
5250
"rollup-plugin-replace": "^1.1.1",
53-
"ts-loader": "^2.0.3",
54-
"typescript": "^2.2.2",
55-
"uglify-js": "^2.8.16",
56-
"vue": "^2.2.6",
57-
"vue-loader": "^11.3.3",
58-
"vue-template-compiler": "^2.2.6",
59-
"webpack": "^2.3.2"
51+
"testdouble": "^3.2.1",
52+
"ts-loader": "^2.2.1",
53+
"typescript": "^2.4.1",
54+
"uglify-js": "^3.0.22",
55+
"vue": "^2.3.4",
56+
"vue-loader": "^13.0.0",
57+
"vue-template-compiler": "^2.3.4",
58+
"webpack": "^3.0.0"
6059
}
6160
}

test/test-babel.js

+10-7
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,8 @@
11
import Component, { createDecorator } from '../lib'
2-
import chai, { expect } from 'chai'
3-
import spies from 'chai-spies'
2+
import { expect } from 'chai'
3+
import * as td from 'testdouble'
44
import Vue from 'vue'
55

6-
chai.use(spies)
7-
86
describe('vue-class-component with Babel', () => {
97
it('should be instantiated without any errors', () => {
108
@Component
@@ -49,7 +47,8 @@ describe('vue-class-component with Babel', () => {
4947
})
5048

5149
it('warn if class property is used without inheriting Vue class', () => {
52-
const spy = chai.spy.on(console, 'warn')
50+
const originalWarn = console.warn
51+
console.warn = td.function('warn')
5352

5453
@Component({
5554
foo: Number
@@ -67,6 +66,10 @@ describe('vue-class-component with Babel', () => {
6766
'Component class must inherit Vue or its descendant class ' +
6867
'when class property is used.'
6968

70-
expect(spy).to.have.been.called.with(message)
69+
try {
70+
td.verify(console.warn(message))
71+
} finally {
72+
console.warn = originalWarn
73+
}
7174
})
72-
})
75+
})

0 commit comments

Comments
 (0)