Skip to content

Commit 522a0f8

Browse files
committed
test: set a really long timeout for HMR tests
1 parent 72ba750 commit 522a0f8

File tree

3 files changed

+9
-7
lines changed

3 files changed

+9
-7
lines changed

packages/@vue/cli-plugin-typescript/__tests__/tsPlugin.helper.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
jest.setTimeout(80000)
2+
13
const path = require('path')
24
const portfinder = require('portfinder')
35
const createServer = require('@vue/cli-test-utils/createServer')
@@ -20,7 +22,7 @@ exports.assertServe = async (name, options) => {
2022
project.write(`src/App.vue`, file.replace(msg, `Updated`))
2123
await nextUpdate() // wait for child stdout update signal
2224
try {
23-
await page.waitForXPath('//h1[contains(text(), "Updated")]')
25+
await page.waitForXPath('//h1[contains(text(), "Updated")]', { timeout: 60000 })
2426
} catch (e) {
2527
if (process.env.APPVEYOR && e.message.match('timeout')) {
2628
// AppVeyor VM is so slow that there's a large chance this test cases will time out,

packages/@vue/cli-service-global/__tests__/globalService.spec.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
jest.setTimeout(40000)
1+
jest.setTimeout(80000)
22

33
const fs = require('fs-extra')
44
const path = require('path')
@@ -36,7 +36,7 @@ test('global serve', async () => {
3636
write('App.vue', entryVue.replace(`{{ msg }}`, 'Updated'))
3737
await nextUpdate() // wait for child stdout update signal
3838
try {
39-
await page.waitForXPath('//h1[contains(text(), "Updated")]')
39+
await page.waitForXPath('//h1[contains(text(), "Updated")]', { timeout: 60000 })
4040
} catch (e) {
4141
if (process.env.APPVEYOR && e.message.match('timeout')) {
4242
// AppVeyor VM is so slow that there's a large chance this test cases will time out,

packages/@vue/cli-service/__tests__/serve.spec.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
jest.setTimeout(60000)
1+
jest.setTimeout(80000)
22

33
const path = require('path')
44
const fs = require('fs-extra')
@@ -20,7 +20,7 @@ test('serve', async () => {
2020
project.write(`src/App.vue`, file.replace(msg, `Updated`))
2121
await nextUpdate() // wait for child stdout update signal
2222
try {
23-
await page.waitForXPath('//h1[contains(text(), "Updated")]')
23+
await page.waitForXPath('//h1[contains(text(), "Updated")]', { timeout: 60000 })
2424
} catch (e) {
2525
if (process.env.APPVEYOR && e.message.match('timeout')) {
2626
// AppVeyor VM is so slow that there's a large chance this test cases will time out,
@@ -113,7 +113,7 @@ test('serve with inline entry', async () => {
113113
project.write(`src/App.vue`, file.replace(msg, `Updated`))
114114
await nextUpdate() // wait for child stdout update signal
115115
try {
116-
await page.waitForXPath('//h1[contains(text(), "Updated")]')
116+
await page.waitForXPath('//h1[contains(text(), "Updated")]', { timeout: 60000 })
117117
} catch (e) {
118118
if (process.env.APPVEYOR && e.message.match('timeout')) {
119119
// AppVeyor VM is so slow that there's a large chance this test cases will time out,
@@ -143,7 +143,7 @@ test('serve with no public dir', async () => {
143143
project.write(`src/App.vue`, file.replace(msg, `Updated`))
144144
await nextUpdate() // wait for child stdout update signal
145145
try {
146-
await page.waitForXPath('//h1[contains(text(), "Updated")]')
146+
await page.waitForXPath('//h1[contains(text(), "Updated")]', { timeout: 60000 })
147147
} catch (e) {
148148
if (process.env.APPVEYOR && e.message.match('timeout')) {
149149
// AppVeyor VM is so slow that there's a large chance this test cases will time out,

0 commit comments

Comments
 (0)