mirror of
https://bitbucket.org/wisemapping/wisemapping-frontend.git
synced 2024-11-27 00:24:55 +01:00
20 lines
567 B
TypeScript
20 lines
567 B
TypeScript
import { addMatchImageSnapshotCommand } from 'cypress-image-snapshot/command';
|
|
import '@testing-library/cypress/add-commands';
|
|
|
|
// make matchImageSnapshot() call the real implementation only if CYPRESS_imageSnaphots is set
|
|
// otherwise it calls a noop
|
|
if (Cypress.env('imageSnaphots')) {
|
|
addMatchImageSnapshotCommand({
|
|
failureThreshold: 0.001,
|
|
failureThresholdType: 'percent',
|
|
});
|
|
} else {
|
|
Cypress.Commands.add(
|
|
'matchImageSnapshot',
|
|
{
|
|
prevSubject: ['optional', 'element', 'window', 'document'],
|
|
},
|
|
() => Promise.resolve(),
|
|
);
|
|
}
|