americanexpress/jest-image-snapshot

`updatePassedSnapshot` updates all snapshot regardless of jest `--updatesnapshot` value

JeremyJonas opened this issue ยท 1 comments

const shouldUpdate = ({ pass, updateSnapshot, updatePassedSnapshot }) => (
(!pass && updateSnapshot) || (pass && updatePassedSnapshot)
);

Expected Result

I expected updatePassedSnapshot to only update "passed" snapshots when jest --updatesnapshot flag is present.

Current Result

When updatePassedSnapshot is true, it will always update all snapshot, regardless of being enabled in jest.

Proposal

Only consider updatePassedSnapshot if updateSnapshot is also true, which I am assuming it aligned to jest flag.

 const shouldUpdate = ({ pass, updateSnapshot, updatePassedSnapshot }) => updateSnapshot && (!pass || (pass && updatePassedSnapshot)

๐ŸŽ‰ This issue has been resolved in version 6.1.1 ๐ŸŽ‰

The release is available on:

Your semantic-release bot ๐Ÿ“ฆ๐Ÿš€