[WIP] Initial support for passing back fixits with --json
#5718
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.
Summary
I'd like the Jest runner to provide enough information so that jest-editor-support or a watcher plugin could provide an implementation of a fixit. Re: #4442
So for this test:
It would result in this JSON:
Things that are still a bit ambiguous
The data here is going to need to be enough to have an AST runner dig through the tree to find the right
expect
and subsequent assertion.So in this case:
test
/it
with the same name1
not a variableI feel like the fixit should probably include the matcher name, and maybe I could even include the first line of the error'd stack trace in there to provide a way to verify that the change is on the right one
Test plan
Would like to add an integration test to verify the whole system