File tree Expand file tree Collapse file tree 3 files changed +11
-9
lines changed Expand file tree Collapse file tree 3 files changed +11
-9
lines changed Original file line number Diff line number Diff line change 1+ import { throwError } from './util'
2+
3+ if ( typeof window === 'undefined' ) {
4+ throwError (
5+ 'window is undefined, vue-test-utils needs to be run in a browser environment.\n' +
6+ 'You can run the tests in node using jsdom + jsdom-global.\n' +
7+ 'See https://vue-test-utils.vuejs.org/en/guides/common-tips.html for more details.'
8+ )
9+ }
Original file line number Diff line number Diff line change 11// @flow
22
3+ import './lib/warn-if-no-window'
34import Vue from 'vue'
45import VueWrapper from './wrappers/vue-wrapper'
56import createInstance from './lib/create-instance'
6- import { throwError } from './lib/util'
77import cloneDeep from 'lodash/cloneDeep'
88import createElement from './lib/create-element'
99import './lib/matches-polyfill'
1010
1111Vue . config . productionTip = false
1212
1313export default function mount ( component : Component , options : Options = { } ) : VueWrapper {
14- if ( ! window ) {
15- throwError (
16- 'window is undefined, vue-test-utils needs to be run in a browser environment.\n' +
17- 'You can run the tests in node using jsdom + jsdom-global.\n' +
18- 'See https://vue-test-utils.vuejs.org/en/guides/common-tips.html for more details.'
19- )
20- }
21-
2214 const componentToMount = options . clone === false ? component : cloneDeep ( component )
2315 // Remove cached constructor
2416 delete componentToMount . _Ctor
Original file line number Diff line number Diff line change 11// @flow
22
3+ import './lib/warn-if-no-window'
34import Vue from 'vue'
45import cloneDeep from 'lodash/cloneDeep'
56import {
You can’t perform that action at this time.
0 commit comments