Skip to content

Commit

Permalink
WIP: Legacy Percy paths (for testing)
Browse files Browse the repository at this point in the history
  • Loading branch information
bartaz committed Mar 4, 2020
1 parent 8ae172b commit 755c36a
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion snapshots.js
Expand Up @@ -21,7 +21,14 @@ PercyScript.run(async (page, percySnapshot) => {
await page.waitFor('body');

// create percy snapshot with path as a name
const path = new URL(url).pathname.replace(/\/?$/, '/');
let path = new URL(url).pathname.replace(/\/?$/, '/');

if (path.indexOf('/docs/') === -1) {
path = '/site' + path;
} else {
path = path.replace('/docs', '');
}

await percySnapshot(path, {widths: [375, 1280]});
}
});

0 comments on commit 755c36a

Please sign in to comment.