Skip to content

Commit bcf96c7

Browse files
committed
test: assert extension resolution order in node_modules
1 parent fc41979 commit bcf96c7

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

tests/fixtures.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -260,7 +260,9 @@ export const files = {
260260
'pkg-commonjs': {
261261
'package.json': createPackageJson({
262262
type: 'commonjs',
263+
main: './index.js',
263264
}),
265+
'index.ts': 'throw new Error("should prefer .js over .ts in node_modules")',
264266
'index.js': syntaxLowering,
265267
'ts.ts': syntaxLowering,
266268
'cjs.js': `
@@ -282,6 +284,7 @@ export const files = {
282284
'#*': './*',
283285
},
284286
}),
287+
'index.ts': 'throw new Error("should prefer .js over .ts in node_modules")',
285288
'index.js': `${syntaxLowering}\nexport * from "./empty-export"`,
286289
'empty-export/index.js': 'export {}',
287290
'ts.ts': `${syntaxLowering}\nexport * from "#empty.js"`,

0 commit comments

Comments
 (0)