Skip to content

Property 'matchImageSnapshot' does not exist on type 'cy & EventEmitter' #220

Open
@iten74

Description

@iten74

Configured the plugin as outlined but cypress does not recognize it. The plugin works if I add @ts-ignore in front of the line cy.matchImageSnapshot();, but I'd rather be able to configure the framework correctly so cypress doesn't complain.
Any idea?

index.js:

const cucumber = require('cypress-cucumber-preprocessor').default;
const browserify = require('@cypress/browserify-preprocessor');
const resolve = require('resolve');
const { addMatchImageSnapshotPlugin } = require('cypress-image-snapshot/plugin');

module.exports = (on, config) => {
    const options = {
        ...browserify.defaultOptions,
        typescript: resolve.sync('typescript', { baseDir: config.projectRoot })
    };
    on('file:preprocessor', cucumber(options));
    addMatchImageSnapshotPlugin(on, config);
};

commands.js

import { addMatchImageSnapshotCommand } from 'cypress-image-snapshot/command';
addMatchImageSnapshotCommand();

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions