@@ -12,7 +12,7 @@ import { packageTypes } from '../utils/package-types.js';
12
12
const wasmPath = path . resolve ( 'tests/fixtures/test.wasm' ) ;
13
13
const wasmPathUrl = pathToFileURL ( wasmPath ) . toString ( ) ;
14
14
15
- export default testSuite ( async ( { describe } , { tsx } : NodeApis ) => {
15
+ export default testSuite ( async ( { describe } , { tsx, supports } : NodeApis ) => {
16
16
describe ( 'Smoke' , ( { describe } ) => {
17
17
for ( const packageType of packageTypes ) {
18
18
const isCommonJs = packageType === 'commonjs' ;
@@ -151,7 +151,11 @@ export default testSuite(async ({ describe }, { tsx }: NodeApis) => {
151
151
expect ( p . stdout ) . toMatch ( / \{ " i m p o r t M e t a U r l " : " f i l e : \/ \/ \/ .+ ?\/ j s \/ i n d e x \. j s " , " _ _ f i l e n a m e " : " .+ ?i n d e x \. j s " \} / ) ;
152
152
expect ( p . stdout ) . toMatch ( / \{ " i m p o r t M e t a U r l " : " f i l e : \/ \/ \/ .+ ?\/ j s \/ i n d e x \. j s \? q u e r y = 1 2 3 " , " _ _ f i l e n a m e " : " .+ ?i n d e x \. j s " \} / ) ;
153
153
} else {
154
- expect ( p . stdout ) . toMatch ( '"pkgCommonjs":{"default":{"default":1,"named":2}}' ) ;
154
+ expect ( p . stdout ) . toMatch (
155
+ supports . cjsInterop
156
+ ? '"pkgCommonjs":{"default":{"default":1,"named":2},"named":2}'
157
+ : '"pkgCommonjs":{"default":{"default":1,"named":2}}' ,
158
+ ) ;
155
159
156
160
expect ( p . stdout ) . toMatch ( / \{ " i m p o r t M e t a U r l " : " f i l e : \/ \/ \/ .+ ?\/ j s \/ i n d e x \. j s " \} / ) ;
157
161
expect ( p . stdout ) . toMatch ( / \{ " i m p o r t M e t a U r l " : " f i l e : \/ \/ \/ .+ ?\/ j s \/ i n d e x \. j s \? q u e r y = 1 2 3 " \} / ) ;
@@ -365,7 +369,11 @@ export default testSuite(async ({ describe }, { tsx }: NodeApis) => {
365
369
expect ( p . stdout ) . toMatch ( / \{ " i m p o r t M e t a U r l " : " f i l e : \/ \/ \/ .+ ?\/ j s \/ i n d e x \. j s " , " _ _ f i l e n a m e " : " .+ ?i n d e x \. j s " \} / ) ;
366
370
expect ( p . stdout ) . toMatch ( / \{ " i m p o r t M e t a U r l " : " f i l e : \/ \/ \/ .+ ?\/ j s \/ i n d e x \. j s \? q u e r y = 1 2 3 " , " _ _ f i l e n a m e " : " .+ ?i n d e x \. j s " \} / ) ;
367
371
} else {
368
- expect ( p . stdout ) . toMatch ( '"pkgCommonjs":{"default":{"default":1,"named":2}}' ) ;
372
+ expect ( p . stdout ) . toMatch (
373
+ supports . cjsInterop
374
+ ? '"pkgCommonjs":{"default":{"default":1,"named":2},"named":2}'
375
+ : '"pkgCommonjs":{"default":{"default":1,"named":2}}' ,
376
+ ) ;
369
377
370
378
expect ( p . stdout ) . toMatch ( / \{ " i m p o r t M e t a U r l " : " f i l e : \/ \/ \/ .+ ?\/ j s \/ i n d e x \. j s " \} / ) ;
371
379
expect ( p . stdout ) . toMatch ( / \{ " i m p o r t M e t a U r l " : " f i l e : \/ \/ \/ .+ ?\/ j s \/ i n d e x \. j s \? q u e r y = 1 2 3 " \} / ) ;
0 commit comments