Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
export async function expectIdenticalScreenshots(
screenshot: Buffer,
baselineName: string,
message?: string
) {
const { BROWSER } = process.env;
const baseline = await fs.readFile(
path.join(__dirname, `./screenshots/${BROWSER}/${baselineName}.png`)
);
// eslint-disable-next-line no-unused-expressions
expect((await pixelDiffer.compare(baseline, screenshot)).matches, message).to.be.true;
}