Experimental test helper: it.experimental
#17149
Merged
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
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
orit.experimental.only
xit
->xit.experimental
it.skip
->it.skip.experimental
orit.experimental.skip
Since
it
is an alias oftest
,test.experimental
works, 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.