diff --git a/packages/jest-environment/src/index.ts b/packages/jest-environment/src/index.ts index 42cb7f8927c1..8cff39793cb8 100644 --- a/packages/jest-environment/src/index.ts +++ b/packages/jest-environment/src/index.ts @@ -45,7 +45,10 @@ export declare class JestEnvironment { exportConditions?: () => Array; } -export type Module = NodeModule; +export interface Module extends NodeModule { + // for some reason missing: https://nodejs.org/api/modules.html#modules_module_path + path: string; +} // TODO: Move to some separate package export interface Jest { diff --git a/packages/jest-runtime/src/index.ts b/packages/jest-runtime/src/index.ts index ffe5bc4a64aa..e114af83460f 100644 --- a/packages/jest-runtime/src/index.ts +++ b/packages/jest-runtime/src/index.ts @@ -5,7 +5,7 @@ * LICENSE file in the root directory of this source tree. */ -import * as nativeModule from 'module'; +import nativeModule = require('module'); import * as path from 'path'; import {URL, fileURLToPath, pathToFileURL} from 'url'; import {