Skip to content
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

Merged

Conversation

trueadm
Copy link
Contributor

@trueadm trueadm commented Feb 28, 2017

This PR addresses points outlined in #9069, specifically:

  • the Stack dependent test in src/renderers/__tests__/ReactUpdates-test.js has been removed
  • the Stack dependent test in src/renderers/dom/shared/__tests__/ReactMount-test.js has been removed
  • the Stack tests in src/renderers/dom/shared/__tests__/ReactDOMComponent-test.js have been refactored to use the public API rather than internal Stack modules
  • the test in src/renderers/dom/shared/__tests__/ReactDOMIDOperations-test.js has been refactored to use the public API and moved into src/renderers/dom/shared/__tests__/ReactDOMComponent-test.js

@@ -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
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: "renders"

Copy link
Collaborator

@gaearon gaearon left a 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);
});

Copy link
Collaborator

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.

Copy link
Collaborator

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.

Copy link
Collaborator

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.

@trueadm trueadm merged commit 18b86bc into facebook:master Mar 1, 2017
@gaearon gaearon mentioned this pull request Oct 20, 2017
26 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants