-
Notifications
You must be signed in to change notification settings - Fork 397
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
test(ssr): add test for dynamic imports (#4878)
Co-authored-by: Will Harney <[email protected]>
- Loading branch information
1 parent
88bf8a7
commit cd36585
Showing
9 changed files
with
32 additions
and
0 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
Empty file.
5 changes: 5 additions & 0 deletions
5
packages/@lwc/engine-server/src/__tests__/fixtures/dynamic-imports/basic/expected.html
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 |
---|---|---|
@@ -0,0 +1,5 @@ | ||
<x-dynamic-component> | ||
<template shadowrootmode="open"> | ||
Importee: | ||
</template> | ||
</x-dynamic-component> |
3 changes: 3 additions & 0 deletions
3
packages/@lwc/engine-server/src/__tests__/fixtures/dynamic-imports/basic/index.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 |
---|---|---|
@@ -0,0 +1,3 @@ | ||
export const tagName = 'x-dynamic-component'; | ||
export { default } from 'x/dynamic'; | ||
export * from 'x/dynamic'; |
3 changes: 3 additions & 0 deletions
3
...engine-server/src/__tests__/fixtures/dynamic-imports/basic/modules/x/dynamic/dynamic.html
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 |
---|---|---|
@@ -0,0 +1,3 @@ | ||
<template> | ||
Importee: {importee} | ||
</template> |
12 changes: 12 additions & 0 deletions
12
...c/engine-server/src/__tests__/fixtures/dynamic-imports/basic/modules/x/dynamic/dynamic.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 |
---|---|---|
@@ -0,0 +1,12 @@ | ||
import { LightningElement } from 'lwc'; | ||
|
||
export default class DynamicCtor extends LightningElement { | ||
importee | ||
|
||
constructor() { | ||
super() | ||
import('x/fake').then(result => { | ||
this.importee = result | ||
}) | ||
} | ||
} |
1 change: 1 addition & 0 deletions
1
...es/@lwc/engine-server/src/__tests__/fixtures/dynamic-imports/basic/modules/x/fake/fake.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 |
---|---|---|
@@ -0,0 +1 @@ | ||
export default "do not actually import me" |
3 changes: 3 additions & 0 deletions
3
packages/@lwc/engine-server/src/__tests__/utils/custom-loader.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 |
---|---|---|
@@ -0,0 +1,3 @@ | ||
export function load() { | ||
return Promise.resolve('stub'); | ||
} |
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