Skip to content

Commit abc616e

Browse files
authored
fix (#1642)
1 parent 751c0df commit abc616e

File tree

1 file changed

+17
-1
lines changed

1 file changed

+17
-1
lines changed

src/test/esm-loader.spec.ts

+17-1
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,23 @@ if (nodeSupportsImportAssertions) {
117117
'parentURL',
118118
]);
119119
} else if (json.loadContextKeys) {
120-
expect(json.loadContextKeys).toEqual(['format', 'importAssertions']);
120+
try {
121+
expect(json.loadContextKeys).toEqual([
122+
'format',
123+
'importAssertions',
124+
]);
125+
} catch (e) {
126+
// HACK for https://github.com/TypeStrong/ts-node/issues/1641
127+
if (process.version.includes('nightly')) {
128+
expect(json.loadContextKeys).toEqual([
129+
'format',
130+
'importAssertions',
131+
'parentURL',
132+
]);
133+
} else {
134+
throw e;
135+
}
136+
}
121137
} else {
122138
throw new Error('Unexpected stdout in test.');
123139
}

0 commit comments

Comments
 (0)