-
-
Notifications
You must be signed in to change notification settings - Fork 6.5k
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
jest-circus test utilities #5636
Conversation
5119965
to
6d1f34c
Compare
packages/jest-util/package.json
Outdated
@@ -13,8 +13,7 @@ | |||
"graceful-fs": "^4.1.11", | |||
"is-ci": "^1.0.10", | |||
"jest-message-util": "^22.4.0", | |||
"mkdirp": "^0.5.1", | |||
"source-map": "^0.6.0" | |||
"mkdirp": "^0.5.1" |
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.
not sure why this and yarn.lock
got messed up. am i using an old yarn version on something? or is master currently out of sync?
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.
this is weird - source-map was just added in #5594. Maybe you need a rebase?
running yarn
on master for me does not change the lockfile either
6d1f34c
to
34cdb39
Compare
Nice! |
const CIRCUS_RUN_PATH = path.resolve(__dirname, '../../build/run'); | ||
const CIRCUS_STATE_PATH = path.resolve(__dirname, '../../build/state'); | ||
const TEST_EVENT_HANDLER_PATH = path.resolve(__dirname, './test_event_handler'); | ||
const BABEL_REGISTER_PATH = path.resolve( |
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.
can you use require.resolve
or require.main.resolve
here?
ee8bc8c
to
cc8d701
Compare
replaced |
a5f6621
to
20093b0
Compare
20093b0
to
4859724
Compare
Codecov Report
@@ Coverage Diff @@
## master #5636 +/- ##
=======================================
Coverage 63.16% 63.16%
=======================================
Files 216 216
Lines 7913 7913
Branches 3 4 +1
=======================================
Hits 4998 4998
Misses 2914 2914
Partials 1 1 Continue to review full report at Codecov.
|
add_hook: beforeEach | ||
add_test: one | ||
add_test: two | ||
start_describe_definition: 2nd level describe |
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.
This test would be even better if it had the depth represented with indents. Would you mind adding that?
This pull request has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
utility function that runs a test using
jest-circus
and logs every event that goes through the event handler. (see snapshot test)This is useful to test the definition and execution flow and make sure future work won't break the flow. (e.g.
beforeEach
suddenly isn't invoked before test)