77
88import * as fs from 'graceful-fs' ;
99import pnpResolver from 'jest-pnp-resolver' ;
10- import { sync as resolveSync } from 'resolve' ;
10+ import { Opts as ResolveOpts , sync as resolveSync } from 'resolve' ;
1111import type { Config } from '@jest/types' ;
1212import { tryRealpath } from 'jest-util' ;
1313
14- type ResolverOptions = {
14+ interface ResolverOptions extends ResolveOpts {
1515 basedir : Config . Path ;
1616 browser ?: boolean ;
17+ conditions ?: Array < string > ;
1718 defaultResolver : typeof defaultResolver ;
1819 extensions ?: Array < string > ;
19- moduleDirectory ?: Array < string > ;
20- paths ?: Array < Config . Path > ;
2120 rootDir ?: Config . Path ;
22- packageFilter ?: (
23- pkg : Record < string , unknown > ,
24- pkgfile : string ,
25- ) => Record < string , unknown > ;
26- pathFilter ?: (
27- pkg : Record < string , unknown > ,
28- path : string ,
29- relativePath : string ,
30- ) => string ;
31- conditions ?: Array < string > ;
32- } ;
21+ }
3322
3423// https://github.com/facebook/jest/pull/10617
3524declare global {
@@ -51,14 +40,9 @@ export default function defaultResolver(
5140 }
5241
5342 const result = resolveSync ( path , {
54- basedir : options . basedir ,
55- extensions : options . extensions ,
43+ ...options ,
5644 isDirectory,
5745 isFile,
58- moduleDirectory : options . moduleDirectory ,
59- packageFilter : options . packageFilter ,
60- pathFilter : options . pathFilter ,
61- paths : options . paths ,
6246 preserveSymlinks : false ,
6347 readPackageSync,
6448 realpathSync,
0 commit comments