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 ' +