Commit fbf0fa8 1 parent c78905c commit fbf0fa8 Copy full SHA for fbf0fa8
File tree 2 files changed +9
-3
lines changed
packages/jest-runtime/src
2 files changed +9
-3
lines changed Original file line number Diff line number Diff line change 8
8
### Fixes
9
9
10
10
- ` [@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 ) )
11
12
12
13
### Chore & Maintenance
13
14
Original file line number Diff line number Diff line change @@ -2319,9 +2319,14 @@ export default class Runtime {
2319
2319
'Your test environment does not support `mocked`, please update it.' ,
2320
2320
) ;
2321
2321
} ) ;
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
+ } ;
2325
2330
2326
2331
const setTimeout = ( timeout : number ) => {
2327
2332
this . _environment . global [ testTimeoutSymbol ] = timeout ;
You can’t perform that action at this time.
0 commit comments