test(e2e): restore report generation and fix location of received images #3145
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.



When an test failure occurred, the report was not generated and the development server did not stop at the end of the test execution.
This was due to our custom function
toMatchImageSnapshotbecoming asynchronous in commit bffd25b.The original function is synchronous, so the custom function must be too.
In addition to this fix, the logic of the code managing image attachments has been improved, mainly to better separate responsibilities.
Storing the expected image copy and calculating the image location are specific to j-i-s, so there's no need to do this. to j-i-s, and are therefore performed first.
The function for attaching images to the report only uses the previously calculated image location and is unaware that j-i-s is being used.
For tests that redefined the location of output images (usually in a subfolder), the path to the received images was not updated accordingly. It was stored in the same location for each test, so only one file was kept and not stored with the diff and the expected image.
Also regenerate the image for the “subprocess.03.collapsed.with.elements” test.
Notes
First detection of problems fixed in this PR:
Error reproductions and progressive fix with the "overlays" e2e tests
Command run:
DEBUG=bv:test:jest:img npm run test:e2e -- --runTestsByPath test/e2e/overlays.rendering.test.tsExamples of reports generated with all tests involving "custom received directory"