-
Notifications
You must be signed in to change notification settings - Fork 1.1k
[bug] act-compat assume console.error is called with a string #442
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
Comments
This seems fine, since the condition is always false (never matches) when the input is not a string |
Agreed. Would you like to make a pull request for this @SBoudrias? |
@kentcdodds I can go ahead and add some type checking to the args for this. |
@ely-alamillo you still taking this? I can also do this one? |
@rvdkooy yes, there was a blocking issue but it's now resolved so i'm still working on this. If I don't get anything in by the eow you can take it. |
Why does this case exist if it's not doing anything ? https://github.com/testing-library/react-testing-library/blob/master/src/act-compat.js#L38 |
Because otherwise this would run: react-testing-library/src/act-compat.js Line 45 in 8881803
|
react-testing-library
version:react
version:node
version:npm
(oryarn
) version:Relevant code or config:
Code is situated here: https://github.com/testing-library/react-testing-library/blob/master/src/act-compat.js#L32
This assumes the first arg passed to
console.error
is a string; but the type could be different. For example, it can be an objectconsole.error({ error })
Suggested solution:
We could either:
indexOf
The text was updated successfully, but these errors were encountered: