jest-specific-snapshot icon indicating copy to clipboard operation
jest-specific-snapshot copied to clipboard

retryTimes() generates a new snapshot on each retry

Open Hypnosphi opened this issue 10 months ago • 0 comments

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

Hypnosphi avatar Aug 28 '23 14:08 Hypnosphi