Skip to content

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

Merged
mdjastrzebski merged 2 commits into
callstack:mainfrom
yusufyildirim:main
Jul 29, 2024
Merged

fix: respect to the "testingLibrary" config option#515
mdjastrzebski merged 2 commits into
callstack:mainfrom
yusufyildirim:main

Conversation

@yusufyildirim

Copy link
Copy Markdown
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.

@changeset-bot

changeset-bot Bot commented Jul 22, 2024

Copy link
Copy Markdown

🦋 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

@mdjastrzebski mdjastrzebski left a comment

Copy link
Copy Markdown
Member

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
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