-
-
Notifications
You must be signed in to change notification settings - Fork 20
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
13 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,19 @@ | ||
require('browser-env')(); | ||
// ./test/_setup.js | ||
|
||
// Set up JSDom. | ||
require('jsdom-global')() | ||
|
||
// Fix the Date object, see <https://github.com/vuejs/vue-test-utils/issues/936#issuecomment-415386167>. | ||
window.Date = Date | ||
|
||
// Setup browser environment | ||
const hooks = require('require-extension-hooks'); | ||
const Vue = require('vue'); | ||
|
||
// Setup Vue.js to remove production tip | ||
Vue.config.productionTip = false; | ||
|
||
// Setup vue files to be processed by `require-extension-hooks-vue` | ||
hooks('vue').plugin('vue').push(); | ||
hooks(['vue', 'js']).plugin('babel').push(); | ||
// Setup vue and js files to be processed by `require-extension-hooks-babel` | ||
hooks(['vue', 'js']).exclude(({filename}) => filename.match(/\/node_modules\//)).plugin('babel').push(); |