Skip to content

Commit

Permalink
New ReactShallowRenderer implementation
Browse files Browse the repository at this point in the history
Replaced shallow renderer based on test renderer with a custom, isolated implementation that's stack and fiber compatible
  • Loading branch information
Brian Vaughn committed Apr 17, 2017
1 parent 71bb1cd commit 86bfb52
Show file tree
Hide file tree
Showing 4 changed files with 420 additions and 328 deletions.
2 changes: 2 additions & 0 deletions scripts/fiber/tests-passing.txt
Original file line number Diff line number Diff line change
Expand Up @@ -1560,6 +1560,7 @@ src/renderers/dom/shared/wrappers/__tests__/ReactDOMTextarea-test.js
* should warn if value and defaultValue are specified

src/renderers/dom/test/__tests__/ReactTestUtils-test.js
* should only render 1 level deep
* should have shallow rendering
* should shallow render a functional component
* should throw for invalid elements
Expand All @@ -1573,6 +1574,7 @@ src/renderers/dom/test/__tests__/ReactTestUtils-test.js
* can setState in componentWillMount when shallow rendering
* can pass context when shallowly rendering
* can fail context when shallowly rendering
* should warn about propTypes (but only once)
* can scryRenderedDOMComponentsWithClass with TextComponent
* can scryRenderedDOMComponentsWithClass with className contains \n
* can scryRenderedDOMComponentsWithClass with multiple classes
Expand Down
7 changes: 0 additions & 7 deletions src/isomorphic/classic/element/ReactElement.js
Original file line number Diff line number Diff line change
Expand Up @@ -162,13 +162,6 @@ var ReactElement = function(type, key, ref, self, source, owner, props) {
writable: false,
value: source,
});
// _owner attribute would break shallow renderer equality checks.
Object.defineProperty(element, '_owner', {
configurable: false,
enumerable: false,
writable: false,
value: owner,
});
} else {
element._store.validated = false;
element._self = self;
Expand Down
Loading

0 comments on commit 86bfb52

Please sign in to comment.