GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Remove unnecessary error overriding in (#19949) · react/react@cc77be9

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
  • packages/shared/__tests__
    • ReactErrorProd-test.internal.js
Expand file treeCollapse file tree
Open diff view settings
Collapse file

‎packages/shared/__tests__/ReactErrorProd-test.internal.js‎

Copy file name to clipboardExpand all lines: packages/shared/__tests__/ReactErrorProd-test.internal.js
-18Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -11,29 +11,11 @@
1111
let formatProdErrorMessage;
1212

1313
describe('ReactErrorProd', () => {
14-
let globalErrorMock;
15-
1614
beforeEach(() => {
17-
if (!__DEV__) {
18-
// In production, our Jest environment overrides the global Error
19-
// class in order to decode error messages automatically. However
20-
// this is a single test where we actually *don't* want to decode
21-
// them. So we assert that the OriginalError exists, and temporarily
22-
// set the global Error object back to it.
23-
globalErrorMock = global.Error;
24-
global.Error = globalErrorMock.OriginalError;
25-
expect(typeof global.Error).toBe('function');
26-
}
2715
jest.resetModules();
2816
formatProdErrorMessage = require('shared/formatProdErrorMessage').default;
2917
});
3018

31-
afterEach(() => {
32-
if (!__DEV__) {
33-
global.Error = globalErrorMock;
34-
}
35-
});
36-
3719
it('should throw with the correct number of `%s`s in the URL', () => {
3820
expect(formatProdErrorMessage(124, 'foo', 'bar')).toEqual(
3921
'Minified React error #124; visit ' +

0 commit comments

Comments
0 (0)
You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.