Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] Outdated-snapshot-reporter fails with custom snapshot ids #341

Open
LauriNieminen opened this issue Sep 5, 2023 · 0 comments
Open

Comments

@LauriNieminen
Copy link

Describe the bug

Outdated-snapshot-reporter assumes that all snapshot files end with -snap.png. Files that end differently are not reported nor removed when obsolete.

Provide step-by-step guide on how to reproduce the bug

Use a customSnapshotIdentifier that does not end with -snap.png with outdated-snapshot-reporter enabled.
Existing snapshot files will be ignored by the reporter.

expect(image).toMatchImageSnapshot({
    customSnapshotIdentifier: customFilename,
  })
{
(...)
reporters: [
    'default',
    'jest-image-snapshot/src/outdated-snapshot-reporter.js',
    ['jest-junit', { outputDirectory: './build/test-reports/jest' }],
    'jest-stare',
  ],
}

Expected behavior

Outdated-snapshot-reporter does not make assumptions about snapshot identifiers or exposes the suffix as a configurable parameter. Bare minimum would be to document the assumption extremely clearly.

System information

  • Version of jest-image-snapshot: 6.1.0
  • Node version: 18.14.2
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant