Adds a new job for running unit tests in GH Actions #50
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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 indispatchTransaction
that was basically impossible to wrap in anact
call in tests. This means that our tests were complaining about state updates that weren't wrapped inact
(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 astate
prop is passed, which all of our tests do. To quiet the test logs, this PR makes theforceUpdate
call conditional on the absence of astate
prop.