Skip to content

Commit f0f3d97

Browse files
committed
fix(rush-sdk): fix unit test in CI with node <= 20.18
1 parent 0e9d213 commit f0f3d97

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

libraries/rush-sdk/src/test/build-assets-with-named-exports.test.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,11 @@ describe('@rushstack/rush-sdk named exports check', () => {
77
it('Should import named exports correctly (lib-shim)', () => {
88
const result = Executable.spawnSync('node', [
99
'-e',
10+
// Do not use top level await here because it is not supported in Node.js < 20.20
1011
`
11-
const { RushConfiguration } = await import('@rushstack/rush-sdk');
12+
import('@rushstack/rush-sdk').then(({ RushConfiguration }) => {
1213
console.log(typeof RushConfiguration.loadFromConfigurationFile);
14+
});
1315
`
1416
]);
1517
expect(result.stdout.trim()).toEqual('function');
@@ -20,7 +22,7 @@ console.log(typeof RushConfiguration.loadFromConfigurationFile);
2022
const result = Executable.spawnSync('node', [
2123
'-e',
2224
`
23-
const { RushConfiguration } = await import('@rushstack/rush-sdk/lib/api/RushConfiguration');
25+
import('@rushstack/rush-sdk').then(({ RushConfiguration }) => {
2426
console.log(typeof RushConfiguration.loadFromConfigurationFile);
2527
`
2628
]);

0 commit comments

Comments
 (0)