-
Notifications
You must be signed in to change notification settings - Fork 2
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
[fixusageoutsidejest] Allow import outside of jest #1018
Conversation
🦋 Changeset detectedLatest commit: ed94c9c The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
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 |
GeraldRequired Reviewers
Don't want to be involved in this pull request? Comment |
@@ -1,8 +1,5 @@ | |||
import {verifyRealTimers} from "./internal/verify-real-timers"; | |||
import {unverifiedWait} from "./internal/unverified-wait"; | |||
import {assertJest} from "./internal/assert-jest"; | |||
|
|||
assertJest(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
note: The wait
call invokes a verifyRealTimers
call, which in turn will call assertJest
so we're still covered, just not at import time.
Codecov Report
Additional details and impacted files@@ Coverage Diff @@
## main #1018 +/- ##
==========================================
+ Coverage 99.85% 99.92% +0.07%
==========================================
Files 97 97
Lines 1393 1389 -4
Branches 359 343 -16
==========================================
- Hits 1391 1388 -3
Misses 1 1
+ Partials 1 0 -1
... and 3 files with indirect coverage changes Continue to review full report in Codecov by Sentry.
|
Size Change: -2 B (0%) Total Size: 4.66 kB
ℹ️ View Unchanged
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah, nice!
👏 Thank you for addressing this. |
Summary:
The
wait
function copied from Webapp verified that jest was in use at import. This worked when in webapp and it was just a file being imported, but now it's in Wonder Stuff Testing, it causes an error if any of the non-jest code is used outside of a jest environment, which is not what we want at all.So, this removes that module level check, which in turn means Wonder Stuff Testing can be used in non-jest contexts, like stories.
See Slack thread for more context, if you have access.
Issue: XXX-XXXX
Test plan:
yarn test
Once published, we can update webapp and verify
dataFactoryFor
is usable within stories.