File tree Expand file tree Collapse file tree
src/renderers/shared/fiber/__tests__ Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -453,6 +453,7 @@ src/renderers/dom/__tests__/ReactDOMProduction-test.js
453453* should use prod React
454454* should handle a simple flow
455455* should call lifecycle methods
456+ * should throw with an error code in production
456457
457458src/renderers/dom/fiber/__tests__/ReactDOMFiber-test.js
458459* should render strings as children
@@ -816,6 +817,7 @@ src/renderers/shared/fiber/__tests__/ReactIncrementalErrorHandling-test.js
816817* continues work on other roots despite caught errors
817818* continues work on other roots despite uncaught errors
818819* force unmounts failed subtree before rerendering
820+ * force unmounts failed subtree before rerendering (fragment)
819821* force unmounts failed root
820822
821823src/renderers/shared/fiber/__tests__/ReactIncrementalReflection-test.js
Original file line number Diff line number Diff line change @@ -1482,30 +1482,26 @@ describe('ReactIncremental', () => {
14821482 ReactNoop . flush ( ) ;
14831483 ops = [ ] ;
14841484
1485- expect ( instance . state . n ) . toEqual ( 0 ) ;
1486-
1487- // first good callback
1488- instance . setState ( { n : 1 } , ( ) => ops . push ( 'first good callback' ) ) ;
1489- ReactNoop . flush ( ) ;
1485+ function updater ( { n } ) {
1486+ return { n : n + 1 } ;
1487+ }
14901488
1491- // callback throws
1492- instance . setState ( { n : 2 } , ( ) => {
1493- throw new Error ( 'Bail' ) ;
1489+ instance . setState ( updater , ( ) => ops . push ( 'first callback' ) ) ;
1490+ instance . setState ( updater , ( ) => {
1491+ ops . push ( 'second callback' ) ;
1492+ throw new Error ( 'callback error' ) ;
14941493 } ) ;
1494+ instance . setState ( updater , ( ) => ops . push ( 'third callback' ) ) ;
1495+
14951496 expect ( ( ) => {
14961497 ReactNoop . flush ( ) ;
1497- } ) . toThrow ( 'Bail' ) ;
1498-
1499- // should set state to 2 even if callback throws up
1500- expect ( instance . state . n ) . toEqual ( 2 ) ;
1501-
1502- // another good callback
1503- instance . setState ( { n : 3 } , ( ) => ops . push ( 'second good callback' ) ) ;
1504- ReactNoop . flush ( ) ;
1498+ } ) . toThrow ( 'callback error' ) ;
15051499
1500+ // Should call all callbacks, even though the second one throws
15061501 expect ( ops ) . toEqual ( [
1507- 'first good callback' ,
1508- 'second good callback' ,
1502+ 'first callback' ,
1503+ 'second callback' ,
1504+ 'third callback' ,
15091505 ] ) ;
15101506 expect ( instance . state . n ) . toEqual ( 3 ) ;
15111507 } ) ;
You can’t perform that action at this time.
0 commit comments