jest-specific-snapshot
jest-specific-snapshot copied to clipboard
retryTimes() generates a new snapshot on each retry
jest.retryTimes(3)
describe('foo', () => {
it('works', () => {
expect(1).toMatchSpecificSnapshot('foo.snap')
throw new Error()
})
})
expected: only 1 snapshot is written actual: each retry has its own snapshot
// Jest Snapshot v1, https://goo.gl/fbAQLP
exports[`foo works 1`] = `1`;
exports[`foo works 2`] = `1`;
exports[`foo works 3`] = `1`;
exports[`foo works 4`] = `1`;
related: https://github.com/jestjs/jest/issues/7493