-
-
Notifications
You must be signed in to change notification settings - Fork 6.1k
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
4 changed files
with
8 additions
and
24 deletions.
There are no files selected for viewing
20 changes: 5 additions & 15 deletions
20
packages/playground/dynamic-import/__tests__/dynamic-import.spec.ts
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,29 +1,19 @@ | ||
import { untilUpdated } from '../../testUtils' | ||
import { isBuild, untilUpdated } from '../../testUtils' | ||
|
||
test('should load literal dynamic import', async () => { | ||
await page.click('.baz') | ||
await untilUpdated(() => page.textContent('.view'), 'Baz view') | ||
await untilUpdated(() => page.textContent('.view'), 'Baz view', true) | ||
}) | ||
|
||
test('should load full dynamic import from public', async () => { | ||
await page.click('.qux') | ||
await untilUpdated(() => page.textContent('.view'), 'Qux view') | ||
await untilUpdated(() => page.textContent('.view'), 'Qux view', true) | ||
}) | ||
|
||
// since this test has a timeout, it should be put last so that it | ||
// does not bleed on the last | ||
test('should load dynamic import with vars', async () => { | ||
await page.click('.foo') | ||
await untilUpdated(() => page.textContent('.view'), 'Foo view') | ||
await untilUpdated(() => page.textContent('.view'), 'Foo view', true) | ||
|
||
// first page click will not load the remote message | ||
// because vite needs to compile the lodash dependency | ||
await page.click('.bar') | ||
await untilUpdated(() => page.textContent('.view'), '') | ||
|
||
// wait until reload and click again | ||
setTimeout(async () => { | ||
await page.click('.bar') | ||
await untilUpdated(() => page.textContent('.view'), 'Bar view') | ||
}, 10) | ||
await untilUpdated(() => page.textContent('.view'), 'Bar view', true) | ||
}) |
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
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,5 +1 @@ | ||
import { n } from '../nested/shared' | ||
import { isBoolean } from 'lodash' | ||
console.log('bar' + isBoolean(n)) | ||
|
||
export const msg = 'Bar view' |
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