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

ReactElementValidator.loggedTypeFailures prevents test isolation #4725

Closed
ryanwilsonperkin opened this issue Aug 27, 2015 · 2 comments
Closed

Comments

@ryanwilsonperkin
Copy link

I'm running React v0.13.3 and testing with jasmine-core v2.3.4.

When testing my component validation, I use jasmine's spyOn method to mock out console.warn and check that TestUtils.renderIntoDocument will trigger a warning with the correct message when validation fails. I use expect(console.warn).toHaveBeenCalledWith(...) to check that validation is working.

I run the same unit test, in two separate test suites (tests/fileA.js and tests/fileB.js) that expects the warning to occur. Because React globally tracks which warnings have been triggered (to avoid spamming the console it seems) it doesn't send the warning the second time, and thus fails.

I would expect that TestUtils.renderIntoDocument would setup isolation for each render so that warnings can be checked properly.

@nickpresta
Copy link
Contributor

This seems related to #4302

@sophiebits
Copy link
Collaborator

Yeah, I'll close this in favor of #4302.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants