Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save wilcoschoneveld/49b23b7825997fa1b41c668be77eb6a4 to your computer and use it in GitHub Desktop.
Save wilcoschoneveld/49b23b7825997fa1b41c668be77eb6a4 to your computer and use it in GitHub Desktop.
diff --git a/node_modules/cypress-image-snapshot/plugin.js b/node_modules/cypress-image-snapshot/plugin.js
index 106d726..4ca37b5 100644
--- a/node_modules/cypress-image-snapshot/plugin.js
+++ b/node_modules/cypress-image-snapshot/plugin.js
@@ -96,7 +96,9 @@ function matchImageSnapshotPlugin({ path: screenshotPath }) {
// remove the cypress v5+ native retries suffix from the file name
const snapshotIdentifier = name.replace(/ \(attempt [0-9]+\)/, '');
- const relativePath = _path2.default.relative(screenshotsFolder, screenshotDir);
+ // always write snapshot images to root snapshots directory
+ // this is a workaround for https://github.com/jaredpalmer/cypress-image-snapshot/issues/61
+ const relativePath = "";
const snapshotsDir = customSnapshotsDir ? _path2.default.join(process.cwd(), customSnapshotsDir, relativePath) : _path2.default.join(screenshotsFolder, '..', 'snapshots', relativePath);
const snapshotKebabPath = _path2.default.join(snapshotsDir, `${snapshotIdentifier}${kebabSnap}`);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment