Closed d3c0d3dpt closed 3 years ago
Hi guys, I'm having some doubts regarding the checklist item "My change requires a change to the documentation and I have updated the documentation accordingly.". How should I add this to the documentation?
In regards to updating the readme, I would add that the customSnapshotIdentifier
can also be used to add custom directory path.
This feature is currently available through the customSnapshotsDir
parameter. I can see the advantage of this change but my initial impression is that this feature could reduce the clarity of the API.
The customSnapshotsDir
options does not allows a function to be passed. When no value it's given, the screenshots will be created alongside the test files, which provides a different screenshot organisation than keeping all of them on a separate folder (achieved when the value is given).
:tada: This PR is included in version 4.5.0 :tada:
The release is available on:
Your semantic-release bot :package::rocket:
Allow users to add paths to the Snapshot Identifier option.
Description
Improved creation of folders (via
mkdirp
) to use thepath.dirname
of the screenshot, instead of only using the screenshots/diff folders.Motivation and Context
Allow better organization of screenshots, allowing to use folders. This allows to improve the snapshot organization when using visual tests for different pages, making use of the
customSnapshotIdentifier
option to dynamically organize the snapshots according to the test set they belong to.How Has This Been Tested?
Unit tests added;
Tested on another application by using the following:
A name like "Home Screen 1280 x 720 Full Page Render" is converted to "Home/1280 x 720/Full Page Render" where screenshots are organized by page, screen size and test name.
Types of Changes
Checklist:
What is the Impact to Developers Using Jest-Image-Snapshot?
Allowing better organization of snapshots.