-
-
Notifications
You must be signed in to change notification settings - Fork 2.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Extend test utils to execute ESM bundles (#5548)
- Loading branch information
Showing
11 changed files
with
361 additions
and
110 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
4 changes: 2 additions & 2 deletions
4
...ages/core/integration-tests/test/integration/formats/esm-async-chained-reexport2/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 |
---|---|---|
@@ -1,4 +1,4 @@ | ||
import { createAndFireEvent } from "./library/b.js"; | ||
var createAndFireEventOnAtlaskit = createAndFireEvent("index"); | ||
output = import("./library/a.js") | ||
.then((m) => [createAndFireEventOnAtlaskit(), m.default(), m.a]); | ||
|
||
export default import("./library/a.js").then((m) => [createAndFireEventOnAtlaskit(), m.default(), m.a]); |
2 changes: 1 addition & 1 deletion
2
packages/core/integration-tests/test/integration/formats/esm-async/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 |
---|---|---|
@@ -1 +1 @@ | ||
output = import('./async').then(a => a.foo + 2); | ||
export default import('./async').then(a => a.foo + 2); |
9 changes: 3 additions & 6 deletions
9
packages/core/integration-tests/test/integration/formats/esm-bundle-import-reexport/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 |
---|---|---|
@@ -1,8 +1,5 @@ | ||
import {T} from "./i18n"; | ||
import {T} from './i18n/index.js'; | ||
|
||
const version = import("./version.js"); | ||
const version = import('./version.js'); | ||
|
||
console.log( | ||
T("index"), | ||
version.then(v => "Diagram" + v.default()) | ||
); | ||
export default version.then((v) => [T('index'), 'Diagram' + v.default()]); |
2 changes: 1 addition & 1 deletion
2
...ges/core/integration-tests/test/integration/formats/esm-bundle-import-reexport/version.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
4 changes: 1 addition & 3 deletions
4
packages/core/integration-tests/test/integration/formats/esm-split/async1.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,6 +1,4 @@ | ||
import _ from 'lodash'; | ||
import react from 'react'; | ||
|
||
console.log('async1'); | ||
console.log(_); | ||
console.log(react); | ||
export default ['async1', _, react]; |
4 changes: 1 addition & 3 deletions
4
packages/core/integration-tests/test/integration/formats/esm-split/async2.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,6 +1,4 @@ | ||
import _ from 'lodash'; | ||
import react from 'react'; | ||
|
||
console.log('async2'); | ||
console.log(_); | ||
console.log(react); | ||
export default ['async2', _, react]; |
6 changes: 4 additions & 2 deletions
6
packages/core/integration-tests/test/integration/formats/esm-split/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 |
---|---|---|
@@ -1,2 +1,4 @@ | ||
import('./async1'); | ||
import('./async2'); | ||
export default Promise.all([import('./async1'), import('./async2')]).then( | ||
([{default: [a, b, c]}, {default: [x, y, z]}]) => | ||
a === 'async1' && x === 'async2' && b === y && c === z, | ||
); |
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 |
---|---|---|
|
@@ -2,4 +2,4 @@ if (Date.now() < 0) { | |
let x = require("./c.js"); | ||
} | ||
|
||
output = import("./b.js"); | ||
export default import("./b.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
Oops, something went wrong.