From d51c01f42c1ca94f368f7a2aa810e9fc3171ead1 Mon Sep 17 00:00:00 2001 From: Hiroki Osame Date: Mon, 6 Nov 2023 15:30:57 +0900 Subject: [PATCH] wip --- tests/specs/smoke.ts | 24 +++++++++++++++++++++++- 1 file changed, 23 insertions(+), 1 deletion(-) diff --git a/tests/specs/smoke.ts b/tests/specs/smoke.ts index a0104c0a9..48c6d170c 100644 --- a/tests/specs/smoke.ts +++ b/tests/specs/smoke.ts @@ -330,6 +330,7 @@ export default testSuite(async ({ describe }, { tsx }: NodeApis) => { ...files, 'package.json': JSON.stringify({ type: packageType }), 'import-from-js.js': ` + import assert from 'assert'; import { expectErrors } from './expect-errors'; // node: prefix @@ -343,7 +344,17 @@ export default testSuite(async ({ describe }, { tsx }: NodeApis) => { // import * as js from './js/index.js?query=123'; Support query import './js/index'; import './js/'; - + + // No double .default.default in Dynamic Import + import('./js/index.js').then(m => { + if (typeof m.default === 'object') { + assert( + !('default' in m.default), + 'Should not have double .default.default in Dynamic Import', + ); + } + }); + // .json import * as json from './json/index.json'; import './json/index'; @@ -438,6 +449,7 @@ export default testSuite(async ({ describe }, { tsx }: NodeApis) => { 'package.json': JSON.stringify({ type: packageType }), 'import-from-ts.ts': ` + import assert from 'assert'; import { expectErrors } from './expect-errors'; // node: prefix @@ -455,6 +467,16 @@ export default testSuite(async ({ describe }, { tsx }: NodeApis) => { import './js/index'; import './js/'; + // No double .default.default in Dynamic Import + import('./js/index.js').then(m => { + if (typeof m.default === 'object') { + assert( + !('default' in m.default), + 'Should not have double .default.default in Dynamic Import', + ); + } + }); + // .json import * as json from './json/index.json'; import './json/index';