Skip to content

Commit

Permalink
Tighten type definition of Module
Browse files Browse the repository at this point in the history
  • Loading branch information
SimenB committed Oct 7, 2017
1 parent 97a74bb commit d7848d1
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions packages/jest-runtime/src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,14 +29,14 @@ import {run as cilRun} from './cli';
import {options as cliOptions} from './cli/args';

type Module = {|
children?: Array<any>,
children: Array<Module>,
exports: any,
filename: string,
id: string,
loaded: boolean,
parent?: Module,
paths?: Array<Path>,
require?: Function,
require?: (id: string) => any,
|};

type HasteMapOptions = {|
Expand Down Expand Up @@ -77,6 +77,7 @@ const getModuleNameMapper = (config: ProjectConfig) => {
};

const mockParentModule: Module = {
children: [],
exports: {},
filename: 'mock.js',
id: 'mockParent',
Expand Down Expand Up @@ -318,6 +319,7 @@ class Runtime {
// circular dependencies that may arise while evaluating the module can
// be satisfied.
const localModule: Module = {
children: [],
exports: {},
filename: modulePath,
id: modulePath,
Expand Down Expand Up @@ -391,6 +393,7 @@ class Runtime {

if (manualMock) {
const localModule: Module = {
children: [],
exports: {},
filename: modulePath,
id: modulePath,
Expand Down

0 comments on commit d7848d1

Please sign in to comment.