From 9a5576f4d263ac5d7a9462a287d1524fda3355b8 Mon Sep 17 00:00:00 2001 From: Paul Doyle Date: Fri, 2 Oct 2020 11:21:46 -0700 Subject: [PATCH] Remove unnecessary error overriding in --- .../__tests__/ReactErrorProd-test.internal.js | 18 ------------------ 1 file changed, 18 deletions(-) diff --git a/packages/shared/__tests__/ReactErrorProd-test.internal.js b/packages/shared/__tests__/ReactErrorProd-test.internal.js index 27679bc529920..fc00dbb236c02 100644 --- a/packages/shared/__tests__/ReactErrorProd-test.internal.js +++ b/packages/shared/__tests__/ReactErrorProd-test.internal.js @@ -11,29 +11,11 @@ let formatProdErrorMessage; describe('ReactErrorProd', () => { - let globalErrorMock; - beforeEach(() => { - if (!__DEV__) { - // In production, our Jest environment overrides the global Error - // class in order to decode error messages automatically. However - // this is a single test where we actually *don't* want to decode - // them. So we assert that the OriginalError exists, and temporarily - // set the global Error object back to it. - globalErrorMock = global.Error; - global.Error = globalErrorMock.OriginalError; - expect(typeof global.Error).toBe('function'); - } jest.resetModules(); formatProdErrorMessage = require('shared/formatProdErrorMessage').default; }); - afterEach(() => { - if (!__DEV__) { - global.Error = globalErrorMock; - } - }); - it('should throw with the correct number of `%s`s in the URL', () => { expect(formatProdErrorMessage(124, 'foo', 'bar')).toEqual( 'Minified React error #124; visit ' +