fix: reload every spec file when support updated #17598
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.
User facing changelog
Using
[email protected]
and@cypress/[email protected]
saving support files or its dependencies does not re-run the tests.Since support is imported before every specFile, it should re-run the tests of the open spec file.
This PR makes sure the tests are re-run.
Technical explanation
In
cypress<8
, component testing always re-run the current test whenever any dependency of any test is updated.In
cypress>8
, component testingcompile:success
can take aspecFile
flag to scope the refresh to a specFile. This way when you change the dependencies of spec A and only spec B is open, the tests are not re-run with exactly the same result. If nospecFile
is specified, cypress re-runs anyway.supportFile
is not exactly a spec but was considered as such in <8.It is now treated separately (which simplifies the code and the logs)