File tree 3 files changed +9
-5
lines changed
jest-types/__typechecks__
3 files changed +9
-5
lines changed Original file line number Diff line number Diff line change 4
4
5
5
### Fixes
6
6
7
- - ` [matcher-utils] ` Correct diff for expected asymmetric matchers ([ #12264 ] ( https://github.com/facebook/jest/pull/12264 ) )
8
7
- ` [expect] ` Add a fix for ` .toHaveProperty('') ` ([ #12251 ] ( https://github.com/facebook/jest/pull/12251 ) )
8
+ - ` [@jest/globals] ` Add missing ` options ` argument to ` jest.doMock ` typing ([ #12292 ] ( https://github.com/facebook/jest/pull/12292 ) )
9
9
- ` [jest-environment-node] ` Add ` atob ` and ` btoa ` ([ #12269 ] ( https://github.com/facebook/jest/pull/12269 ) )
10
+ - ` [jest-matcher-utils] ` Correct diff for expected asymmetric matchers ([ #12264 ] ( https://github.com/facebook/jest/pull/12264 ) )
10
11
- ` [jest-message-util] ` Fix ` .getTopFrame() ` (and ` toMatchInlineSnapshot() ` ) with ` mjs ` files ([ #12277 ] ( https://github.com/facebook/jest/pull/12277 ) )
11
12
12
13
### Chore & Maintenance
Original file line number Diff line number Diff line change @@ -92,7 +92,11 @@ export interface Jest {
92
92
* the top of the code block. Use this method if you want to explicitly avoid
93
93
* this behavior.
94
94
*/
95
- doMock ( moduleName : string , moduleFactory ?: ( ) => unknown ) : Jest ;
95
+ doMock (
96
+ moduleName : string ,
97
+ moduleFactory ?: ( ) => unknown ,
98
+ options ?: { virtual ?: boolean } ,
99
+ ) : Jest ;
96
100
/**
97
101
* Indicates that the module system should never return a mocked version
98
102
* of the specified module from require() (e.g. that it should always return
Original file line number Diff line number Diff line change @@ -20,9 +20,8 @@ expectType<typeof jest>(jest.deepUnmock('moduleName'));
20
20
expectType < typeof jest > ( jest . disableAutomock ( ) ) ;
21
21
expectType < typeof jest > ( jest . doMock ( 'moduleName' ) ) ;
22
22
expectType < typeof jest > ( jest . doMock ( 'moduleName' , jest . fn ( ) ) ) ;
23
-
24
- expectError ( jest . doMock ( 'moduleName' , jest . fn ( ) , { } ) ) ;
25
- expectError ( jest . doMock ( 'moduleName' , jest . fn ( ) , { virtual : true } ) ) ;
23
+ expectType < typeof jest > ( jest . doMock ( 'moduleName' , jest . fn ( ) , { } ) ) ;
24
+ expectType < typeof jest > ( jest . doMock ( 'moduleName' , jest . fn ( ) , { virtual : true } ) ) ;
26
25
27
26
expectType < typeof jest > ( jest . dontMock ( 'moduleName' ) ) ;
28
27
expectType < typeof jest > ( jest . enableAutomock ( ) ) ;
You can’t perform that action at this time.
0 commit comments