-
Notifications
You must be signed in to change notification settings - Fork 47k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Fiber] Remove stack dependencies from tests #9080
[Fiber] Remove stack dependencies from tests #9080
Conversation
@@ -1071,14 +1070,13 @@ src/renderers/dom/shared/__tests__/ReactDOMComponent-test.js | |||
* gives source code refs for unknown prop warning for exact elements | |||
* gives source code refs for unknown prop warning for exact elements in composition | |||
* should suggest property name if available | |||
* renders innerHTML and preserves whitespace | |||
* render and then updates innerHTML and preserves whitespace |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nit: "renders"
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks fine to me, let's merge if CI passes!
ReactDOM.unmountComponentAtNode(container); | ||
expect(Object.keys(ReactMount._instancesByReactRootID).length).toBe(1); | ||
}); | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@gaearon I wonder if we should have a test that mocks__REACT_DEVTOOLS_GLOBAL_HOOK__
and then runs a copy of https://github.com/facebook/react-devtools/blob/master/backend/attachRenderer.js#L24 against it?
The purpose of this test is to ensure that we don't accidentally remove these hooks because they look unused.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm less worried about those since the source is obviously devtools-related, unlike the name _instancesByReactRootID which I deleted at least once accidentally when I thought it was unused.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh, we should just move the backend here. It's still on my todo list but I haven't gotten around to it.
This PR addresses points outlined in #9069, specifically:
src/renderers/__tests__/ReactUpdates-test.js
has been removedsrc/renderers/dom/shared/__tests__/ReactMount-test.js
has been removedsrc/renderers/dom/shared/__tests__/ReactDOMComponent-test.js
have been refactored to use the public API rather than internal Stack modulessrc/renderers/dom/shared/__tests__/ReactDOMIDOperations-test.js
has been refactored to use the public API and moved intosrc/renderers/dom/shared/__tests__/ReactDOMComponent-test.js