Skip to content

Fail tests on any un-spied warnings #4223

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

Merged
merged 1 commit into from
Jun 29, 2015

Conversation

sophiebits
Copy link
Collaborator

Fixes #3890. Fixed existing tests to all set console.error back to its original value when they're done by making them use spyOn.


expect(() => React.render(React.createElement(Empty), container)).toThrow();

expect(warn.mock.calls.length).toBe(1);
expect(warn.mock.calls[0][0]).toBe(
expect((<any>console.error).argsForCall.length).toBe(1);
Copy link
Member

Choose a reason for hiding this comment

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

Do we need to typecast this to make TypeScript happy?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Yeah.

sophiebits added a commit that referenced this pull request Jun 29, 2015
Fail tests on any un-spied warnings
@sophiebits sophiebits merged commit 454d47f into facebook:master Jun 29, 2015
sophiebits added a commit to sophiebits/react that referenced this pull request Sep 30, 2015
Originally facebook#4223 -- we lost this when we switched to jest.
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.

3 participants