Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(jest): remove require.requireActual and require.requireMock #46271

Merged
merged 4 commits into from Jul 31, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
17 changes: 0 additions & 17 deletions types/jest/index.d.ts
Expand Up @@ -72,23 +72,6 @@ type ExtractEachCallbackArgs<T extends ReadonlyArray<any>> = {
: 'fallback'
];

interface NodeRequire {
/**
* Returns the actual module instead of a mock, bypassing all checks on
* whether the module should receive a mock implementation or not.
*
* @deprecated Use `jest.requireActual` instead.
*/
requireActual(moduleName: string): any;
/**
* Returns a mock module instead of the actual module, bypassing all checks
* on whether the module should be required normally or not.
*
* @deprecated Use `jest.requireMock`instead.
*/
requireMock(moduleName: string): any;
}

declare namespace jest {
/**
* Provides a way to add Jasmine-compatible matchers into your Jest context.
Expand Down
10 changes: 0 additions & 10 deletions types/jest/jest-tests.ts
Expand Up @@ -228,16 +228,6 @@ describe('', () => {
});
});

/* NodeRequire interface (require extensions) */

declare const nodeRequire: NodeRequire;

// $ExpectType any
nodeRequire.requireActual('moduleName');

// $ExpectType any
nodeRequire.requireMock('moduleName');

/* Top-level jest namespace functions */

const customMatcherFactories: jasmine.CustomMatcherFactories = {};
Expand Down