-
-
Notifications
You must be signed in to change notification settings - Fork 429
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(ava): e2e test hangs until timeout
- Loading branch information
Showing
5 changed files
with
24 additions
and
14 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,18 +1,19 @@ | ||
{ | ||
"scripts": { | ||
"test": "ava", | ||
"test": "<%= pmRun %> test:unit && <%= pmRun %> test:e2e", | ||
"test:unit": "cross-env TEST=unit ava ./test/specs/**/*", | ||
"test:e2e": "cross-env TEST=e2e ava ./test/e2e/**/*" | ||
}, | ||
"devDependencies": { | ||
"@ava/babel": "^1.0.1", | ||
"@vue/test-utils": "^1.0.0-beta.33", | ||
"ava": "^3.7.1", | ||
"@ava/babel": "^1.0.1", | ||
"babel-plugin-module-resolver": "^4.0.0", | ||
"browser-env": "^3.3.0", | ||
"cross-env": "^5.2.1", | ||
"jsdom": "^16.2.2", | ||
"jsdom-global": "^3.0.2", | ||
"require-extension-hooks": "^0.3.3", | ||
"require-extension-hooks-babel": "^1.0.0", | ||
"require-extension-hooks-vue": "^2.0.0" | ||
"require-extension-hooks-vue": "^3.0.0" | ||
} | ||
} |
18 changes: 11 additions & 7 deletions
18
packages/cna-template/template/frameworks/ava/test/helpers/ava.setup.js
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,11 +1,15 @@ | ||
require('browser-env')() | ||
const hooks = require('require-extension-hooks') | ||
const Vue = require('vue') | ||
if (process.env.TEST === 'unit') { | ||
require('jsdom-global')() | ||
// https://github.com/nuxt/create-nuxt-app/issues/180#issuecomment-463069941 | ||
window.Date = global.Date = Date | ||
} | ||
|
||
const Vue = require('vue') | ||
Vue.config.productionTip = false | ||
|
||
// https://github.com/nuxt/create-nuxt-app/issues/180#issuecomment-463069941 | ||
window.Date = global.Date = Date | ||
|
||
const hooks = require('require-extension-hooks') | ||
hooks('vue').plugin('vue').push() | ||
hooks(['vue', 'js']).exclude(({ filename }) => filename.match(/\/node_modules\//)).plugin('babel').push() | ||
hooks(['vue', 'js']) | ||
.exclude(({ filename }) => filename.match(/\/node_modules\//)) | ||
.plugin('babel') | ||
.push() |
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
Binary file modified
BIN
+65 Bytes
(100%)
packages/create-nuxt-app/test/snapshots/index.test.js.snap
Binary file not shown.
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