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

fix: respect to the "testingLibrary" config option #515

Merged
merged 2 commits into from
Jul 29, 2024

Conversation

yusufyildirim
Copy link
Contributor

Summary

I found out that the testingLibrary option provided in the config object is not respected in the getTestingLibrary function. The function returns 'react-native' no matter what we provide in the configuration.

Looks like the early return statement accidentally removed or forgotten during the v1 effort.

measureRenderInternals function relies on getTestingLibrary and runs this code for react-native. It throws an error with react testing library, thus this tiny mistake makes reassure unusable with react testing library. This PR addresses that issue.

Test plan

Provide react as testingLibrary config option
Ideally, see if it works with @testing-library/react (I don't think there's a setup for that in the repo)
Or, check if getTestingLibrary and resolveTestingLibrary functions resolve properly.

Copy link

changeset-bot bot commented Jul 22, 2024

🦋 Changeset detected

Latest commit: 7f737bb

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 6 packages
Name Type
@callstack/reassure-measure Patch
reassure Patch
@callstack/reassure-cli Patch
@callstack/reassure-compare Patch
@callstack/reassure-danger Patch
@callstack/reassure-logger Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

Copy link
Member

@mdjastrzebski mdjastrzebski left a comment

Choose a reason for hiding this comment

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

Good catch @yusufyildirim! Thanks for fixing this.

@mdjastrzebski mdjastrzebski merged commit 068951b into callstack:main Jul 29, 2024
1 check passed
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

Successfully merging this pull request may close these issues.

2 participants