Typescript
Cypress plugin
// cypress.config.ts
import { defineConfig } from 'cypress';
import getCompareSnapshotsPlugin from 'cypress-image-diff-js/plugin';
export default defineConfig({
e2e: {
setupNodeEvents(on, config) {
return getCompareSnapshotsPlugin(on, config);
},
},
});Cypress support
// cypress/support/{scheme}.ts, where {scheme} defaults to e2e
import compareSnapshotCommand from 'cypress-image-diff-js/command';
// for Cypress v12.17.3 and older
import compareSnapshotCommand from 'cypress-image-diff-js';
compareSnapshotCommand();Troubleshooting

Last updated