Phyllis channelPosted on 2019 October
Pretty heavy mathematics in there. You can also specify the probability threshold. However, snapshots can capture any serializable value and should be used anytime the goal is testing whether the output is correct.
Its premise is super straightforward: Each day at noon, you get one — count them, one — match. The function walks down row by row trying to determine which row to stop on. That old rule about waiting three days to call? As mentioned previously, Jest uses pretty-format to make snapshots human-readable, but you may find it useful to introduce additional tools, like eslint-plugin-jest with its no-large-snapshots option, or snapshot-diff with its component snapshot comparison feature, to promote committing short, focused assertions.