From 74fc0507b012e06fe1eca445bbe784b7980a7baa Mon Sep 17 00:00:00 2001 From: Calvin Liang Date: Thu, 30 Jul 2020 21:47:00 -0700 Subject: [PATCH] =?UTF-8?q?=F0=9F=A4=96=20Merge=20PR=20#46271=20fix(jest):?= =?UTF-8?q?=20remove=20`require.requireActual`=20and=20`require.requireMoc?= =?UTF-8?q?k`=20by=20@CoolCyberBrain?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * remove NodeRequire interface * remove nodeRequire test * remove line --- types/jest/index.d.ts | 17 ----------------- types/jest/jest-tests.ts | 10 ---------- 2 files changed, 27 deletions(-) diff --git a/types/jest/index.d.ts b/types/jest/index.d.ts index a79161f789a26e..c110186106983c 100644 --- a/types/jest/index.d.ts +++ b/types/jest/index.d.ts @@ -71,23 +71,6 @@ type ExtractEachCallbackArgs> = { : '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. diff --git a/types/jest/jest-tests.ts b/types/jest/jest-tests.ts index 47e5b1129b20ea..3079ee9d650b9c 100644 --- a/types/jest/jest-tests.ts +++ b/types/jest/jest-tests.ts @@ -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 = {};