Skip to content

Commit

Permalink
chore(no-deprecated-function): add jest.genMockFromModule
Browse files Browse the repository at this point in the history
  • Loading branch information
G-Rath committed May 3, 2020
1 parent dd7748a commit ac8f641
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 0 deletions.
5 changes: 5 additions & 0 deletions docs/rules/no-deprecated-functions.md
Expand Up @@ -39,3 +39,8 @@ removal in Jest 27.

This function was renamed to `advanceTimersByTime` in Jest 22, and is scheduled
for removal in Jest 27.

### `jest.genMockFromModule`

This function was renamed to `createMockFromModule` in Jest 26, and is scheduled
for removal in a future version of Jest.
1 change: 1 addition & 0 deletions src/rules/__tests__/no-deprecated-functions.ts
Expand Up @@ -9,6 +9,7 @@ const ruleTester = new TSESLint.RuleTester();
['jest.addMatchers', 'expect.extend'],
['jest.resetModuleRegistry', 'jest.resetModules'],
['jest.runTimersToTime', 'jest.advanceTimersByTime'],
['jest.genMockFromModule', 'jest.createMockFromModule'],
].forEach(([deprecation, replacement]) => {
const [deprecatedName, deprecatedFunc] = deprecation.split('.');
const [replacementName, replacementFunc] = replacement.split('.');
Expand Down
1 change: 1 addition & 0 deletions src/rules/no-deprecated-functions.ts
Expand Up @@ -28,6 +28,7 @@ export default createRule({
'jest.addMatchers': 'expect.extend',
'jest.resetModuleRegistry': 'jest.resetModules',
'jest.runTimersToTime': 'jest.advanceTimersByTime',
'jest.genMockFromModule': 'jest.createMockFromModule',
};

return {
Expand Down

0 comments on commit ac8f641

Please sign in to comment.