mirror of
https://github.com/facebook/react.git
synced 2026-02-24 20:53:03 +00:00
* Fix tests to pass when we warn for missing keys in fragments In most cases we just needed to add the 'key' prop. This ignores the tests which are already failing on master when running with ` REACT_DOM_JEST_USE_FIBER=1` - there are 8. All tests should now pass with `npm run test`, and the 8 which fail when running `REACT_DOM_JEST_USE_FIBER=1 npm run test` are the same 8 which are failing on master. * Added missing key warning for children in array fragments After trying twice to reuse the code between the ReactChildFiber and ReactElementValidator, I am thinking that it's simpler to just have some duplication of code. The parts that are shared are interleaved with parts which cannot be shared, either because of singleton modules that must be required differently in 'isomorphic' and the 'renderers', or the fact that 'warning' requires a hard coded string. Test Plan: - Added test to ReactChildren-test - Manually tested via fixture that was not committed. * commit updated "scripts/rollup/results.json" * Make 'ReactChildren-test' more specific, and remove unneeded nesting Based on helpful tips from @spicyj and @aweary's review - Made the unit test for the warning on missing keys more specific - Removed unneeded nesting in the code which generates missing key warning - Change test syntax to use JSX to be more consistent Also fixes flow warning. * Commit update of scripts/rollup/results.json * run "scripts/fiber/record-tests"