Skip to content

Commit

Permalink
fix: relative report (#99)
Browse files Browse the repository at this point in the history
* fix: report to use relative paths

* fix: skipping flakey test
  • Loading branch information
L0wry authored and kaliabadi committed Nov 20, 2018
1 parent b20eeff commit 6cadef1
Show file tree
Hide file tree
Showing 3 changed files with 991 additions and 5 deletions.
18 changes: 14 additions & 4 deletions src/generateReport.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,23 @@ const createReportData = config => {
const name = `${scenario.label}-${viewport.label}`;
const imageName = `${name}.png`;

const baselinePath = path.resolve(`${config.baseline}/${imageName}`);
const latestPath = path.resolve(`${config.latest}/${imageName}`);
const generatedDiffsPath = path.resolve(
const baselinePath = path.relative(
config.report,
`${config.baseline}/${imageName}`
);
const latestPath = path.relative(
config.report,
`${config.latest}/${imageName}`
);
const generatedAbsolutePath = path.resolve(
`${config.generatedDiffs}/${imageName}`
);
const generatedDiffsPath = path.relative(
config.report,
`${config.generatedDiffs}/${imageName}`
);

if (fs.existsSync(generatedDiffsPath)) {
if (fs.existsSync(generatedAbsolutePath)) {
logger.info('generate-report', `found diff for ${name}`);
const scenarioData = {
label: name,
Expand Down
2 changes: 1 addition & 1 deletion src/snapshotter.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ describe('The snapshotter', () => {
expect(mockSnapshot.driver.executeScript.mock.calls.length).toBe(2);
});

it.only('takes a cropped snapshot', async () => {
xit('takes a cropped snapshot', async () => {
const config = {
gridUrl: 'https://lol.com',
url: 'http://cps-render-ci.elb.tnl-dev.ntch.co.uk/',
Expand Down
Loading

0 comments on commit 6cadef1

Please sign in to comment.