diff --git a/src/renderers/shared/fiber/__tests__/ReactIncremental-test.js b/src/renderers/shared/fiber/__tests__/ReactIncremental-test.js index 8fa9afe489..5df5c10caf 100644 --- a/src/renderers/shared/fiber/__tests__/ReactIncremental-test.js +++ b/src/renderers/shared/fiber/__tests__/ReactIncremental-test.js @@ -1465,27 +1465,4 @@ describe('ReactIncremental', () => { ]); expect(instance.state.n).toEqual(4); }); - - it('propagates an error from a noop error boundary', () => { - class NoopBoundary extends React.Component { - unstable_handleError() { - // Noop - } - render() { - return this.props.children; - } - } - - function RenderError() { - throw new Error('render error'); - } - - ReactNoop.render( - - - - ); - - expect(ReactNoop.flush).toThrow('render error'); - }); }); diff --git a/src/renderers/shared/fiber/__tests__/ReactIncrementalErrorHandling-test.js b/src/renderers/shared/fiber/__tests__/ReactIncrementalErrorHandling-test.js new file mode 100644 index 0000000000..53920c99ec --- /dev/null +++ b/src/renderers/shared/fiber/__tests__/ReactIncrementalErrorHandling-test.js @@ -0,0 +1,46 @@ +/** + * Copyright 2013-present, Facebook, Inc. + * All rights reserved. + * + * This source code is licensed under the BSD-style license found in the + * LICENSE file in the root directory of this source tree. An additional grant + * of patent rights can be found in the PATENTS file in the same directory. + * + * @emails react-core + */ + +'use strict'; + +var React; +var ReactNoop; + +describe('ReactIncrementalErrorHandling', () => { + beforeEach(() => { + jest.resetModuleRegistry(); + React = require('React'); + ReactNoop = require('ReactNoop'); + }); + + it('propagates an error from a noop error boundary', () => { + class NoopBoundary extends React.Component { + unstable_handleError() { + // Noop + } + render() { + return this.props.children; + } + } + + function RenderError() { + throw new Error('render error'); + } + + ReactNoop.render( + + + + ); + + expect(ReactNoop.flush).toThrow('render error'); + }); +});