Skip to content

Commit 3f5c39a

Browse files
committed
chore: remove problematic test
1 parent 1c713f0 commit 3f5c39a

File tree

4 files changed

+8
-24
lines changed

4 files changed

+8
-24
lines changed
Lines changed: 5 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,19 @@
1-
import { untilUpdated } from '../../testUtils'
1+
import { isBuild, untilUpdated } from '../../testUtils'
22

33
test('should load literal dynamic import', async () => {
44
await page.click('.baz')
5-
await untilUpdated(() => page.textContent('.view'), 'Baz view')
5+
await untilUpdated(() => page.textContent('.view'), 'Baz view', true)
66
})
77

88
test('should load full dynamic import from public', async () => {
99
await page.click('.qux')
10-
await untilUpdated(() => page.textContent('.view'), 'Qux view')
10+
await untilUpdated(() => page.textContent('.view'), 'Qux view', true)
1111
})
1212

13-
// since this test has a timeout, it should be put last so that it
14-
// does not bleed on the last
1513
test('should load dynamic import with vars', async () => {
1614
await page.click('.foo')
17-
await untilUpdated(() => page.textContent('.view'), 'Foo view')
15+
await untilUpdated(() => page.textContent('.view'), 'Foo view', true)
1816

19-
// first page click will not load the remote message
20-
// because vite needs to compile the lodash dependency
2117
await page.click('.bar')
22-
await untilUpdated(() => page.textContent('.view'), '')
23-
24-
// wait until reload and click again
25-
setTimeout(async () => {
26-
await page.click('.bar')
27-
await untilUpdated(() => page.textContent('.view'), 'Bar view')
28-
}, 10)
18+
await untilUpdated(() => page.textContent('.view'), 'Bar view', true)
2919
})

packages/playground/dynamic-import/package.json

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,5 @@
77
"build": "vite build",
88
"debug": "node --inspect-brk ../../vite/bin/vite",
99
"serve": "vite preview"
10-
},
11-
"dependencies": {
12-
"lodash": "4.17.21"
1310
}
1411
}
Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1 @@
1-
import { n } from '../nested/shared'
2-
import { isBoolean } from 'lodash'
3-
console.log('bar' + isBoolean(n))
4-
51
export const msg = 'Bar view'

packages/playground/testUtils.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -100,9 +100,10 @@ export function readManifest(base = '') {
100100
*/
101101
export async function untilUpdated(
102102
poll: () => string | Promise<string>,
103-
expected: string
103+
expected: string,
104+
runInBuild = false
104105
) {
105-
if (isBuild) return
106+
if (isBuild && !runInBuild) return
106107
const maxTries = process.env.CI ? 100 : 50
107108
for (let tries = 0; tries < maxTries; tries++) {
108109
const actual = (await poll()) || ''

0 commit comments

Comments
 (0)