feat(jest-runtime): expose isEnvironmentTornDown variable #13741
Merged
SimenB merged 11 commits intojestjs:mainfrom Jan 15, 2023
Merged
feat(jest-runtime): expose isEnvironmentTornDown variable #13741SimenB merged 11 commits intojestjs:mainfrom
SimenB merged 11 commits intojestjs:mainfrom
Conversation
added 5 commits
December 27, 2022 19:52
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
SimenB
approved these changes
Jan 7, 2023
Member
SimenB
left a comment
There was a problem hiding this comment.
Can you update the docs (https://github.com/facebook/jest/blob/main/docs/JestObjectAPI.md) and add a unit test?
mrazauskas
reviewed
Jan 7, 2023
Contributor
mrazauskas
left a comment
There was a problem hiding this comment.
Just for completeness, could you add a type test here:
To run these, build the library and run yarn test-types.
mrazauskas
reviewed
Jan 14, 2023
This was referenced Jan 24, 2023
|
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 file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
This PR adds a new feature to the Jest runtime package that exposes the
isEnvironmentTornDownmethod to check if the Jest environment has been torn down programmatically. TheisEnvironmentTornDownfunction returns a boolean that is set totruewhen the environment is torn down andfalseotherwise.The commit also adds documentation for the
isTornDownvariable 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