Commit f5f21d3
test_runner: add exports option for module mocks
Add options.exports support in mock.module() and normalize option
shapes through a shared exports path.
Keep defaultExport and namedExports as aliases, emit runtime
deprecation warnings for legacy options, and update docs and tests,
including output fixtures and coverage snapshots.
Refs: #58443
PR-URL: #61727
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Jacob Smith <jacob@frende.me>
Reviewed-By: Pietro Marchini <pietro.marchini94@gmail.com>
Reviewed-By: Gürgün Dayıoğlu <hey@gurgun.day>
Reviewed-By: Chemi Atlow <chemi@atlow.co.il>1 parent b15ea64 commit f5f21d3
8 files changed
Lines changed: 256 additions & 60 deletions
File tree
- doc/api
- lib/internal/test_runner/mock
- test
- fixtures/test-runner/output
- parallel
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2477 | 2477 | | |
2478 | 2478 | | |
2479 | 2479 | | |
| 2480 | + | |
| 2481 | + | |
| 2482 | + | |
| 2483 | + | |
| 2484 | + | |
| 2485 | + | |
| 2486 | + | |
| 2487 | + | |
| 2488 | + | |
| 2489 | + | |
2480 | 2490 | | |
2481 | 2491 | | |
2482 | 2492 | | |
2483 | 2493 | | |
2484 | 2494 | | |
| 2495 | + | |
| 2496 | + | |
| 2497 | + | |
2485 | 2498 | | |
2486 | 2499 | | |
2487 | 2500 | | |
2488 | 2501 | | |
2489 | 2502 | | |
| 2503 | + | |
| 2504 | + | |
| 2505 | + | |
2490 | 2506 | | |
2491 | 2507 | | |
2492 | 2508 | | |
| |||
2503 | 2519 | | |
2504 | 2520 | | |
2505 | 2521 | | |
2506 | | - | |
| 2522 | + | |
2507 | 2523 | | |
2508 | 2524 | | |
2509 | | - | |
| 2525 | + | |
2510 | 2526 | | |
2511 | 2527 | | |
2512 | 2528 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
113 | 113 | | |
114 | 114 | | |
115 | 115 | | |
116 | | - | |
| 116 | + | |
117 | 117 | | |
118 | 118 | | |
119 | | - | |
| 119 | + | |
120 | 120 | | |
121 | 121 | | |
122 | 122 | | |
| |||
134 | 134 | | |
135 | 135 | | |
136 | 136 | | |
137 | | - | |
| 137 | + | |
138 | 138 | | |
139 | | - | |
| 139 | + | |
140 | 140 | | |
141 | 141 | | |
142 | 142 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |