我按照概述( https://github.com/jaredpalmer/cypress-image-snapshot )配置了插件,但赛普拉斯无法识别它。如果我在 cy.matchImageSnapshot(); 行前面添加@ts-ignore,插件就可以工作,但我宁愿能够正确配置框架,这样赛普拉斯就不会抱怨。任何的想法?
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);
};
命令.js
import { addMatchImageSnapshotCommand } from 'cypress-image-snapshot/command';
addMatchImageSnapshotCommand();