File tree Expand file tree Collapse file tree 2 files changed +10
-4
lines changed Expand file tree Collapse file tree 2 files changed +10
-4
lines changed Original file line number Diff line number Diff line change 1
- // Using dynamic imports for ESM compatibility
2
- import 'cli-testing-library/extend-expect' ;
1
+ // Using Node.js module interop for ESM/CommonJS compatibility
2
+ import { createRequire } from 'module' ;
3
+
4
+ // Create a require function scoped to this module
5
+ const moduleRequire = createRequire ( import . meta. url ) ;
6
+
7
+ // Use the scoped require to import CommonJS modules
8
+ moduleRequire ( 'cli-testing-library/extend-expect' ) ;
3
9
import { configure } from 'cli-testing-library' ;
4
10
import { jest } from '@jest/globals' ;
5
11
Original file line number Diff line number Diff line change 3
3
"target" : " ES2020" ,
4
4
"lib" : [" ES6" , " ES2020" ],
5
5
6
- "module" : " CommonJS " ,
6
+ "module" : " NodeNext " ,
7
7
8
8
"resolveJsonModule" : true ,
9
- "moduleResolution" : " Node " ,
9
+ "moduleResolution" : " NodeNext " ,
10
10
11
11
"allowJs" : true ,
12
12
You can’t perform that action at this time.
0 commit comments