Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
privatenumber committed Nov 6, 2023
1 parent 32f53a4 commit d51c01f
Showing 1 changed file with 23 additions and 1 deletion.
24 changes: 23 additions & 1 deletion tests/specs/smoke.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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';
Expand Down Expand Up @@ -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
Expand All @@ -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';
Expand Down

0 comments on commit d51c01f

Please sign in to comment.