MCPcopy
hub / github.com/jestjs/jest / getContext

Method getContext

packages/jest-runtime/src/internals/EsmLoader.ts:594–602  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

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

Callers 2

tryLoadGraphSyncMethod · 0.95
loadEsmModuleMethod · 0.95

Calls 2

invariantFunction · 0.90
getVmContextMethod · 0.45

Tested by

no test coverage detected