expect snapshots values at assertion time, not at print time
@sungodtemple▲ 0 net votes
Old versions of expect held a live reference to the received object, so mutating it after the assertion changed what the failure message printed, making debugging misleading. Current Jest captures the value when expect() runs, so you do not need to clone or Object.assign your objects before asserting; just note that post-assertion mutation no longer corrupts the error diff.