1
1
# Warns on usage of deprecated functions (no-deprecated-functions)
2
2
3
- Over the years jest has accrued some debt in the form of functions that have
3
+ Over the years Jest has accrued some debt in the form of functions that have
4
4
either been renamed for clarity, or replaced with more powerful APIs.
5
5
6
6
While typically these deprecated functions are kept in the codebase for a number
@@ -13,31 +13,29 @@ what to replace them with.
13
13
14
14
This rule can also autofix a number of these deprecations for you.
15
15
16
- ### ` require.requireActual. ` & ` require.requireMock `
16
+ ### ` require.requireActual ` & ` require.requireMock `
17
17
18
- These functions were removed in Jest 26.
18
+ These functions were replaced in Jest 21 and removed in Jest 26.
19
19
20
- Originally in the early days of jest , the ` requireActual ` & ` requireMock `
21
- functions were placed onto the ` require ` function.
20
+ Originally, the ` requireActual ` & ` requireMock ` the ` requireActual ` &
21
+ ` requireMock ` functions were placed onto the ` require ` function.
22
22
23
- These functions were later moved onto the ` jest ` global, and their use via
24
- ` require ` deprecated. Finally, the release of Jest 26 saw them removed from the
25
- ` require ` function all together.
26
-
27
- The PR implementing the removal can be found
28
- [ here] ( https://github.com/facebook/jest/pull/9854 ) .
23
+ These functions were later moved onto the ` jest ` object in order to be easier
24
+ for type checkers to handle, and their use via ` require ` deprecated. Finally,
25
+ the release of Jest 26 saw them removed from the ` require ` function all
26
+ together.
29
27
30
28
### ` jest.addMatchers `
31
29
32
- This function has been replaced with ` expect.extend ` , and will ideally be
33
- removed in Jest 27.
30
+ This function was replaced with ` expect.extend ` in Jest 17 , and is scheduled for
31
+ removal in Jest 27.
34
32
35
33
### ` jest.resetModuleRegistry `
36
34
37
- This function has been renamed to ` resetModules ` , and will ideally be removed in
38
- Jest 27.
35
+ This function was renamed to ` resetModules ` in Jest 15, and is scheduled for
36
+ removal in Jest 27.
39
37
40
38
### ` jest.runTimersToTime `
41
39
42
- This function has been renamed to ` advanceTimersByTime ` , and will ideally be
43
- removed in Jest 27.
40
+ This function was renamed to ` advanceTimersByTime ` in Jest 22 , and is scheduled
41
+ for removal in Jest 27.
0 commit comments