File tree Expand file tree Collapse file tree 8 files changed +113
-122
lines changed Expand file tree Collapse file tree 8 files changed +113
-122
lines changed Original file line number Diff line number Diff line change @@ -2,6 +2,8 @@ compressionLevel: mixed
22
33enableGlobalCache : true
44
5+ enableTelemetry : false
6+
57logFilters :
68 - code : YN0032
79 level : discard
Original file line number Diff line number Diff line change @@ -41,7 +41,7 @@ exports[`moduleNameMapper wrong array configuration 1`] = `
4141 12 | module.exports = () => 'test';
4242 13 |
4343
44- at createNoMappedModuleFoundError (../../packages/jest-resolve/build/index.js:1117 :17)
44+ at createNoMappedModuleFoundError (../../packages/jest-resolve/build/index.js:1095 :17)
4545 at Object.require (index.js:10:1)
4646 at Object.require (__tests__/index.js:10:20)"
4747` ;
@@ -71,7 +71,7 @@ exports[`moduleNameMapper wrong configuration 1`] = `
7171 12 | module.exports = () => 'test';
7272 13 |
7373
74- at createNoMappedModuleFoundError (../../packages/jest-resolve/build/index.js:1117 :17)
74+ at createNoMappedModuleFoundError (../../packages/jest-resolve/build/index.js:1095 :17)
7575 at Object.require (index.js:10:1)
7676 at Object.require (__tests__/index.js:10:20)"
7777` ;
Original file line number Diff line number Diff line change @@ -26,7 +26,7 @@ exports[`shows a proper error from deep requires 1`] = `
2626 12 | test('dummy', () => {
2727 13 | expect (1 ).toBe (1 );
2828
29- at Resolver ._throwModNotFoundError (../ ../ packages / jest - resolve / build / index .js :863 :11 )
29+ at Resolver ._throwModNotFoundError (../ ../ packages / jest - resolve / build / index .js :841 :11 )
3030 at Object .<anonymous > (node_modules/discord.js/src/index.js:21:12)
3131 at Object.require (__tests__/test.js:10:1)"
3232`;
Original file line number Diff line number Diff line change @@ -37,7 +37,7 @@ exports[`show error message with matching files 1`] = `
3737 | ^
3838 9 |
3939
40- at Resolver._throwModNotFoundError (../../packages/jest-resolve/build/index.js:863 :11)
40+ at Resolver._throwModNotFoundError (../../packages/jest-resolve/build/index.js:841 :11)
4141 at Object.require (index.js:8:18)
4242 at Object.require (__tests__/test.js:8:11)"
4343` ;
Original file line number Diff line number Diff line change 99it ( 'should surface pnp errors' , ( ) => {
1010 expect ( ( ) => {
1111 require ( 'undeclared' ) ;
12- } ) . toThrow ( expect . objectContaining ( { code : 'MODULE_NOT_FOUND' } ) ) ;
12+ } ) . toThrow ( "Cannot find module 'unesitent_module__'" ) ;
1313} ) ;
Original file line number Diff line number Diff line change 2222 "chalk" : " ^4.1.2" ,
2323 "graceful-fs" : " ^4.2.11" ,
2424 "jest-haste-map" : " workspace:*" ,
25- "jest-pnp-resolver" : " ^1.2.3" ,
2625 "jest-util" : " workspace:*" ,
2726 "jest-validate" : " workspace:*" ,
2827 "slash" : " ^3.0.0" ,
29- "unrs-resolver" : " ^1.7.11 "
28+ "unrs-resolver" : " ^1.11.0 "
3029 },
3130 "devDependencies" : {
3231 "@types/graceful-fs" : " ^4.1.9" ,
Original file line number Diff line number Diff line change 66 */
77
88import { isBuiltin } from 'module' ;
9- import { fileURLToPath } from 'url' ;
10- import pnpResolver from 'jest-pnp-resolver' ;
119import {
1210 type ResolveResult ,
1311 ResolverFactory ,
@@ -40,12 +38,6 @@ export interface ResolverOptions extends UpstreamResolveOptions {
4038 paths ?: Array < string > ;
4139 /** Current root directory. */
4240 rootDir ?: string ;
43-
44- /**
45- * @internal Whether to allow the `jest-pnp-resolver` to be used.
46- * @see https://github.com/arcanis/jest-pnp-resolver/blob/ae8e3992349f3b43d1476572e9315e14358e8944/index.js#L49
47- */
48- allowPnp ?: boolean ;
4941}
5042
5143export type SyncResolver = ( path : string , options : ResolverOptions ) => string ;
@@ -74,20 +66,11 @@ function baseResolver(
7466 options : ResolverOptions ,
7567 async ?: true ,
7668) : string | Promise < string > {
77- // https://github.com/oxc-project/oxc-resolver/issues/565
78- // https://github.com/jestjs/jest/issues/15676
69+ // `builtins` in `unrs-resolver` is static which could be wrong at runtime.
7970 if ( isBuiltin ( path ) ) {
8071 return path ;
8172 }
8273
83- if ( process . versions . pnp && options . allowPnp !== false ) {
84- return pnpResolver ( path , options ) ;
85- }
86-
87- if ( path . startsWith ( 'file://' ) ) {
88- path = fileURLToPath ( path ) ;
89- }
90-
9174 /* eslint-disable prefer-const */
9275 let {
9376 basedir,
You can’t perform that action at this time.
0 commit comments