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

Test throwing exceptions #579

Closed
carloslancha opened this issue Feb 20, 2018 · 1 comment
Closed

Test throwing exceptions #579

carloslancha opened this issue Feb 20, 2018 · 1 comment
Assignees
Labels
status: next-release Issues that will enter into the next release

Comments

@carloslancha
Copy link
Contributor

In our components there're some params that are required. In those cases if the param is not passed the component throws an exception.

If we test that like in https://github.com/metal/metal-clay-components/blob/master/packages/clay-alert/src/__tests__/ClayAlert.js#L207 tests passes but in console appears the expected error.

Should we test those cases? If yes, we have to update all our tests with this and find out a way to hide those errors from the logs (like stubbing console.error). If not, we need to remove those tests from ClayAlert and ClayNavbar.

@carloslancha carloslancha self-assigned this Feb 20, 2018
@julien
Copy link
Contributor

julien commented Feb 20, 2018

Hey @carloslancha,

I'm not sure how we want to do that but maybe we could use something like

global.console = {
	error: jest.fn(),
	warn: jest.fn(),
};

And include it in our tests when needed.

jbalsas added a commit that referenced this issue Feb 20, 2018
@jbalsas jbalsas added the status: next-release Issues that will enter into the next release label Feb 20, 2018
kienD pushed a commit to kienD/clay that referenced this issue Feb 21, 2018
kienD pushed a commit to kienD/clay that referenced this issue Feb 21, 2018
kienD pushed a commit to kienD/clay that referenced this issue Feb 21, 2018
kienD pushed a commit to kienD/clay that referenced this issue Feb 21, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status: next-release Issues that will enter into the next release
Projects
None yet
Development

No branches or pull requests

3 participants