-
-
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
feat(jest-runtime): expose isEnvironmentTornDown variable #13741
Conversation
This commit adds a new feature to the Jest runtime package that exposes the `isTornDown` variable as a way to check if the Jest environment has been torn down programmatically. The `isTornDown` variable is a read-only boolean that is set to `true` when the environment is torn down and `false` otherwise. The commit also adds documentation for the `isTornDown` variable to the Jest runtime module. Closes jestjs#13640
This commit adds a new feature to the Jest runtime package that exposes the `isTornDown` variable as a way to check if the Jest environment has been torn down programmatically. The `isTornDown` variable is a read-only boolean that is set to `true` when the environment is torn down and `false` otherwise. The commit also adds documentation for the `isTornDown` variable to the Jest runtime module. Closes jestjs#13640
…/jest into 13640-expose-isTornDown # Conflicts: # packages/jest-environment/src/index.ts
…/jest into 13640-expose-isTornDown # Conflicts: # packages/jest-environment/src/index.ts
…vironmentTornDown variable as a way to check if the Jest environment has been torndown
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 update the docs (https://github.com/facebook/jest/blob/main/docs/JestObjectAPI.md) and add a unit test?
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.
Just for completeness, could you add a type test here:
To run these, build the library and run yarn test-types
.
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.
thanks!
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. |
This PR adds a new feature to the Jest runtime package that exposes the
isEnvironmentTornDown
method to check if the Jest environment has been torn down programmatically. TheisEnvironmentTornDown
function returns a boolean that is set totrue
when the environment is torn down andfalse
otherwise.The commit also adds documentation for the
isTornDown
variable to the Jest runtime module.Closes #13640
Summary
The motivation for exposing the isTornDown variable in the Jest runtime package is to provide a way for tests to check if the Jest environment has been torn down programmatically.
issue #13640 requesting this feature.
Test plan
Test Objective
The objective of this test is to verify that the isTornDown variable is correctly exposed in the Jest runtime package and that it can be used to check if the Jest environment has been torn down programmatically.
Test Steps
Test Expected Results