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

Replace react dom's testing library with ReactTestingLibrary #859

Merged
merged 24 commits into from
Nov 25, 2024

Conversation

davesnx
Copy link
Member

@davesnx davesnx commented Nov 19, 2024

Depends on #846

@davesnx davesnx mentioned this pull request Nov 19, 2024
@davesnx davesnx marked this pull request as ready for review November 19, 2024 20:01
@davesnx davesnx requested a review from jchavarri November 20, 2024 10:55
Copy link
Collaborator

@jchavarri jchavarri left a comment

Choose a reason for hiding this comment

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

I'm afraid I don't know the reason why switching to another (heavier) testing library is needed.

demo/index.html Outdated Show resolved Hide resolved
test/melange-testing-library/README.md Show resolved Hide resolved
Comment on lines +3 to +5
This directory contains a vendored version of the melange-testing-library.

The original repository is https://github.com/melange-community/melange-testing-library
Copy link
Collaborator

Choose a reason for hiding this comment

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

The PR description mentions

Vendors ReactTestingLibrary (and does some ad-hoc changes)

are the ad-hoc changes valuable for other users of the bindings? in that case, will they be upstreamed?

Copy link
Member Author

Choose a reason for hiding this comment

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

Not sure, melange-testing-library contains a few binding designs focused on previous versions of BuckleScript where options aren't translated to undefined, or records aren't objects.

I would keep the changes here and evolve this bindings as a playground for the melange-testing-library

Copy link
Member

Choose a reason for hiding this comment

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

works, but we should upstream as they get better!

@@ -54,11 +59,19 @@ format-check: ## Checks if format is correct
.PHONY: install
install: ## Update the package dependencies when new deps are added to dune-project
@opam install . --deps-only --with-test
@npm install
@npm install --force
Copy link
Collaborator

Choose a reason for hiding this comment

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

Why was force needed?

Copy link
Member Author

Choose a reason for hiding this comment

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

Because testinglib and other deps depend on react 18, so npm complains. It is a decent workaround to ensure the installation succeeds

Copy link
Member Author

Choose a reason for hiding this comment

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

Will write a comment

Copy link
Member

Choose a reason for hiding this comment

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

would we still needed --force if you commit the lockfile from manual install and run npm ci here?

demo/dune Outdated Show resolved Hide resolved
…esting-libraries

* '19' of github.com:/reasonml/reason-react:
  Add deprecations on ReactDOMTestUtils
  Add uri comment back on action
  Update src/React.re
  Update src/React.re
  Update src/React.re
  Snapshot with lower {}
@davesnx davesnx force-pushed the replace-testing-libraries branch from f7d55fe to 7aaef3e Compare November 25, 2024 15:04
…on-react into replace-testing-libraries

* 'replace-testing-libraries' of github.com:/reasonml/reason-react:
  Bind React.act and React.actAsync
@davesnx davesnx merged commit 66cd920 into 19 Nov 25, 2024
3 checks passed
@davesnx davesnx deleted the replace-testing-libraries branch November 25, 2024 17:36
davesnx added a commit that referenced this pull request Nov 25, 2024
…lid-prop

* '19' of github.com:/reasonml/reason-react:
  Replace react dom's testing library with ReactTestingLibrary (#859)
davesnx added a commit that referenced this pull request Nov 25, 2024
…lid-prop

* '19' of github.com:/reasonml/reason-react:
  Replace react dom's testing library with ReactTestingLibrary (#859)
davesnx added a commit that referenced this pull request Nov 25, 2024
…ises-as-annotations

* '19' of github.com:/reasonml/reason-react:
  Enable ref as valid prop (#862)
  Replace react dom's testing library with ReactTestingLibrary (#859)
  Add deprecations on ReactDOMTestUtils
  Add uri comment back on action
  Update src/React.re
  Update src/React.re
  Update src/React.re
  Snapshot with lower {}
@davesnx davesnx mentioned this pull request Nov 25, 2024
davesnx added a commit that referenced this pull request Nov 25, 2024
* '19' of github.com:/reasonml/reason-react:
  Enable ref as valid prop (#862)
  Replace react dom's testing library with ReactTestingLibrary (#859)
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.

3 participants