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

Adds a new job for running unit tests in GH Actions #50

Merged
merged 2 commits into from
Sep 11, 2023
Merged

Conversation

smoores-dev
Copy link
Collaborator

We weren't actually running our unit tests on PRs! Whoops! This adds a new GH Actions job that just runs our unit tests. It's in a separate job so that we can see test results regardless of other static analysis checks succeed or fail.

In addition:

When we added support for uncontrolled state (#34), we added an unconditional forceUpdate call in dispatchTransaction that was basically impossible to wrap in an act call in tests. This means that our tests were complaining about state updates that weren't wrapped in act (though they were all performing correctly, because they were all using controlled state).

This wasn't strictly necessary; the forceUpdate call is only needed when state is uncontrolled, so we don't have to run it when a state prop is passed, which all of our tests do. To quiet the test logs, this PR makes the forceUpdate call conditional on the absence of a state prop.

@smoores-dev smoores-dev requested a review from a team as a code owner September 11, 2023 16:59
@smoores-dev smoores-dev merged commit c1b8f3f into main Sep 11, 2023
2 checks passed
@smoores-dev smoores-dev deleted the test-pr branch September 11, 2023 17:12
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