From bcf96c72b0166b22f761c8200b04d623d57b7c90 Mon Sep 17 00:00:00 2001 From: Hiroki Osame Date: Sat, 22 Jun 2024 08:56:51 +0900 Subject: [PATCH] test: assert extension resolution order in node_modules --- tests/fixtures.ts | 3 +++ 1 file changed, 3 insertions(+) diff --git a/tests/fixtures.ts b/tests/fixtures.ts index d47b7a81..5c749b32 100644 --- a/tests/fixtures.ts +++ b/tests/fixtures.ts @@ -260,7 +260,9 @@ export const files = { 'pkg-commonjs': { 'package.json': createPackageJson({ type: 'commonjs', + main: './index.js', }), + 'index.ts': 'throw new Error("should prefer .js over .ts in node_modules")', 'index.js': syntaxLowering, 'ts.ts': syntaxLowering, 'cjs.js': ` @@ -282,6 +284,7 @@ export const files = { '#*': './*', }, }), + 'index.ts': 'throw new Error("should prefer .js over .ts in node_modules")', 'index.js': `${syntaxLowering}\nexport * from "./empty-export"`, 'empty-export/index.js': 'export {}', 'ts.ts': `${syntaxLowering}\nexport * from "#empty.js"`,