Skip to content

Commit

Permalink
feat(resolve): add paths override to ResolveModuleConfig
Browse files Browse the repository at this point in the history
  • Loading branch information
jeysal committed Jun 15, 2018
1 parent 67fd822 commit 17206c9
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
2 changes: 1 addition & 1 deletion packages/jest-resolve/src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ class Resolver {
moduleName: string,
options?: ResolveModuleConfig,
): ?Path {
const paths = this._options.modulePaths;
const paths = (options && options.paths) || this._options.modulePaths;
const moduleDirectory = this._options.moduleDirectories;
const key = dirname + path.delimiter + moduleName;
const defaultPlatform = this._options.defaultPlatform;
Expand Down
3 changes: 3 additions & 0 deletions types/Resolve.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,11 @@

import type _Resolver from 'jest-resolve';

import type {Path} from './Config';

export type ResolveModuleConfig = {|
skipNodeResolution?: boolean,
paths?: Path[],
|};

export type Resolver = _Resolver;

0 comments on commit 17206c9

Please sign in to comment.