File tree Expand file tree Collapse file tree 2 files changed +9
-3
lines changed
packages/jest-runtime/src Expand file tree Collapse file tree 2 files changed +9
-3
lines changed Original file line number Diff line number Diff line change 88### Fixes
99
1010- ` [@jest/expect-utils] ` ` toMatchObject ` diffs should include ` Symbol ` properties ([ #13810 ] ( https://github.com/facebook/jest/pull/13810 ) )
11+ - ` [jest-runtime] ` Handle missing ` replaceProperty ` ([ #13823 ] ( https://github.com/facebook/jest/pull/13823 ) )
1112
1213### Chore & Maintenance
1314
Original file line number Diff line number Diff line change @@ -2319,9 +2319,14 @@ export default class Runtime {
23192319 'Your test environment does not support `mocked`, please update it.' ,
23202320 ) ;
23212321 } ) ;
2322- const replaceProperty = this . _moduleMocker . replaceProperty . bind (
2323- this . _moduleMocker ,
2324- ) ;
2322+ const replaceProperty =
2323+ typeof this . _moduleMocker . replaceProperty === 'function'
2324+ ? this . _moduleMocker . replaceProperty . bind ( this . _moduleMocker )
2325+ : ( ) => {
2326+ throw new Error (
2327+ 'Your test environment does not support `jest.replaceProperty` - please ensure its Jest dependencies are updated to version 29.4 or later' ,
2328+ ) ;
2329+ } ;
23252330
23262331 const setTimeout = ( timeout : number ) => {
23272332 this . _environment . global [ testTimeoutSymbol ] = timeout ;
You can’t perform that action at this time.
0 commit comments