Skip to content

Commit

Permalink
🤖 Merge PR DefinitelyTyped#46271 fix(jest): remove `require.requireAc…
Browse files Browse the repository at this point in the history
…tual` and `require.requireMock` by @CoolCyberBrain

* remove NodeRequire interface

* remove nodeRequire test

* remove line
  • Loading branch information
Calvin-LL authored and danielrearden committed Sep 22, 2020
1 parent ed8bf83 commit 96e4589
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 27 deletions.
17 changes: 0 additions & 17 deletions types/jest/index.d.ts
Expand Up @@ -71,23 +71,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

0 comments on commit 96e4589

Please sign in to comment.