()
| 592 | } |
| 593 | |
| 594 | private getContext(): VMContext { |
| 595 | invariant( |
| 596 | typeof this.environment.getVmContext === 'function', |
| 597 | 'ES Modules are only supported if your test environment has the `getVmContext` function', |
| 598 | ); |
| 599 | const context = this.environment.getVmContext(); |
| 600 | invariant(context, 'Test environment has been torn down'); |
| 601 | return context; |
| 602 | } |
| 603 | |
| 604 | // Commits (or reuses) a synthetic-module entry under `cacheKey` in both the |
| 605 | // local scratch and the long-lived registry. Returns `false` when the |
no test coverage detected