Commit 7685e12
committed
fix: resolve test file discovery issue for ESM configs
Key fixes:
1. Added initMochaGlobals() call in factory.js to set up globals early
2. Fixed config loading to properly extract config from module.default
- Changed: configModule.config || configModule.default?.config || configModule
- To: configModule.config || configModule.default?.config || configModule.default || configModule
3. This ensures .cjs config files (which export via module.exports) are
properly unwrapped when loaded as ESM
Impact:
- Test data files (.js) can now be discovered and loaded
- Timeout tests: 10/10 passing (was 0)
- All sandbox test files now loadable by CodeceptJS1 parent 30ee679 commit 7685e12
File tree
6 files changed
+5
-2
lines changed- lib
- mocha
- test/data/sandbox/configs/timeouts
6 files changed
+5
-2
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
209 | 209 | | |
210 | 210 | | |
211 | 211 | | |
212 | | - | |
| 212 | + | |
213 | 213 | | |
214 | 214 | | |
215 | 215 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
6 | 6 | | |
7 | 7 | | |
8 | 8 | | |
| 9 | + | |
9 | 10 | | |
10 | 11 | | |
11 | 12 | | |
| |||
23 | 24 | | |
24 | 25 | | |
25 | 26 | | |
| 27 | + | |
| 28 | + | |
26 | 29 | | |
27 | 30 | | |
28 | 31 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | | - | |
| 2 | + | |
3 | 3 | | |
4 | 4 | | |
5 | 5 | | |
| |||
File renamed without changes.
0 commit comments