Open tremorth opened 4 years ago
I am using the configuration object, which can be used to change the path where the HTML report is generated.
So I am running it like this:
const jestScreenshot = require('jest-screenshot'); const {getTestScope} = require('../fakedata'); const {config, toMatchImageSnapshot} = jestScreenshot; jestScreenshot.setupJestScreenshot(); expect.extend({ screenshotMatcher(received, threshold) { const configuration = config(); configuration.snapshotsDir = '../__snapshots__/'; configuration.reportDir = `screenshot-report-${getTestScope()}`; if (threshold) { configuration.pixelThresholdAbsolute = threshold; configuration.pixelThresholdRelative = null; } else { configuration.pixelThresholdRelative = 0; configuration.pixelThresholdAbsolute = 0; } return toMatchImageSnapshot.call(this, received, configuration); } });
Change configuration.reportDir = 'some_dir'
configuration.reportDir = 'some_dir'
Run tests that has failing image
On image-diff failure, index.js or dist-folder are not created under 'some_dir'. No HTML report is available.
index.js
dist
My guess would be, that you also need to configure this for the reporter in the configuration file.
I am using the configuration object, which can be used to change the path where the HTML report is generated.
So I am running it like this:
To reproduce the bug
What the report folder should have:
Change
configuration.reportDir = 'some_dir'
Run tests that has failing image
On image-diff failure,
index.js
ordist
-folder are not created under 'some_dir'. No HTML report is available.What the report folder has: