Experimental test helper: it.experimental#17149
Merged
acdlite merged 1 commit intofacebook:masterfrom Oct 19, 2019
Merged
Conversation
Special version of Jest's `it` for experimental tests. Tests marked as experimental will run **both** stable and experimental modes. In experimental mode, they work the same as the normal Jest methods. In stable mode, they are **expected to fail**. This means we can detect when a test previously marked as experimental can be un-marked when the feature becomes stable. It also reduces the chances that we accidentally add experimental APIs to the stable builds before we intend. I added corresponding methods for the focus and skip APIs: - `fit` -> `fit.experimental` - `it.only` -> `it.only.experimental` or `it.experimental.only` - `xit` -> `xit.experimental` - `it.skip` -> `it.skip.experimental` or `it.experimental.skip` Since `it` is an alias of `test`, `test.experimental` works, too.
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 join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Special version of Jest's
itfor experimental tests. Tests marked as experimental will run both stable and experimental modes. In experimental mode, they work the same as the normal Jest methods. In stable mode, they are expected to fail. This means we can detect when a test previously marked as experimental can be un-marked when the feature becomes stable. It also reduces the chances that we accidentally add experimental APIs to the stable builds before we intend.I added corresponding methods for the focus and skip APIs:
fit->fit.experimentalit.only->it.only.experimentalorit.experimental.onlyxit->xit.experimentalit.skip->it.skip.experimentalorit.experimental.skipSince
itis an alias oftest,test.experimentalworks, too.Here's what it will look like when a test marked as experimental passes in stable:
I only marked a single test as experimental in this PR, to show that it works. I will convert the others in follow ups.