File tree Expand file tree Collapse file tree 4 files changed +345
-5
lines changed Expand file tree Collapse file tree 4 files changed +345
-5
lines changed Original file line number Diff line number Diff line change
1
+ // jsdom setup must be done before importing Vue
2
+ import jsdom from 'jsdom-global'
3
+ jsdom ( )
4
+ process . env . NODE_ENV = 'test'
Original file line number Diff line number Diff line change 17
17
"prebuild:dist" : " rm -rf dist/*" ,
18
18
"build:dist" : " rollup -c && rollup -c --environment PRODUCTION" ,
19
19
"build:watch" : " npm run build:lib -- --watch" ,
20
- "test" : " mocha \" ./src/**/*.test.js\" --require babel-core/register --timeout 5000" ,
20
+ "test" : " mocha \" ./src/**/*.test.js\" --require babel-core/register --require ./mocha-bootstrap -- timeout 5000" ,
21
21
"test:watch" : " npm run test -- --watch" ,
22
22
"lint" : " eslint src" ,
23
23
"prepublish" : " npm run build" ,
58
58
"eslint-plugin-vue" : " ^2.0.1" ,
59
59
"expect" : " ^1.20.2" ,
60
60
"express" : " ^4.14.0" ,
61
+ "jsdom" : " ^11.12.0" ,
62
+ "jsdom-global" : " ^3.0.2" ,
61
63
"lint-staged" : " ^3.2.4" ,
62
64
"lodash" : " ^4.15.0" ,
63
65
"mocha" : " ^3.2.0" ,
Original file line number Diff line number Diff line change @@ -36,9 +36,9 @@ function sheetForTag(tag) {
36
36
}
37
37
}
38
38
39
- const isBrowser = typeof document !== 'undefined'
40
39
const isDev = ( x => ( x === 'development' ) || ! x ) ( process . env . NODE_ENV )
41
40
const isTest = process . env . NODE_ENV === 'test'
41
+ const isBrowser = typeof document !== 'undefined' && ! isTest
42
42
43
43
const oldIE = ( ( ) => {
44
44
if ( isBrowser ) {
You can’t perform that action at this time.
0 commit comments