testing-library / native-testing-library

🐳 Simple and complete React Native testing utilities that encourage good testing practices.
https://native-testing-library.com
MIT License
516 stars 44 forks source link

Fix for console.error argument not being a string #97

Closed AEgan closed 4 years ago

AEgan commented 4 years ago

prevents asyncAct throwing an error if the item being logged isn't a string.

Coped mostly from https://github.com/testing-library/react-testing-library/pull/476

What:

Following a similar PR made in react-testing-library, this fixes an issue where act-compat assumed console.error was being called with a string.

Why:

Current implementation assumes console.error was always called with a string even though it could be called with other types.

How: Wrapped execution of code in a type check if statement to ensure operations are done only on string types.

Checklist:

codecov[bot] commented 4 years ago

Codecov Report

Merging #97 into master will not change coverage. The diff coverage is n/a.

Impacted file tree graph

@@          Coverage Diff          @@
##           master    #97   +/-   ##
=====================================
  Coverage     100%   100%           
=====================================
  Files          20     20           
  Lines         268    268           
  Branches       67     67           
=====================================
  Hits          268    268

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update a1f9f85...2902f8e. Read the comment docs.

bcarroll22 commented 4 years ago

@allcontributors please add @AEgan for code

allcontributors[bot] commented 4 years ago

@bcarroll22

I've put up a pull request to add @AEgan! :tada:

AEgan commented 4 years ago

@bcarroll22 when can we expect a new release that includes this PR?

bcarroll22 commented 4 years ago

:tada: This PR is included in version 6.0.0 :tada:

The release is available on:

Your semantic-release bot :package::rocket: