Files
mermaid/cypress.config.ts
Alois Klink ac625bdc7f test(e2e): fix Cypress config for Node.JS v20.19.0
Node.JS v20.19.0 breaks `import '@cypress/code-coverage/task'` in the
`cypress.config.ts` for some reason (this is probably due to the new
`experimental-require-module` feature that is enabled by default in
Node.JS v20.19.0).

As a work-around, we can change this to
`@cypress/code-coverage/task.js`.

See: https://github.com/cypress-io/code-coverage/pull/940
See: https://nodejs.org/en/blog/release/v20.19.0
2025-03-25 18:28:13 +09:00

40 lines
1.4 KiB
TypeScript

import eyesPlugin from '@applitools/eyes-cypress';
import { registerArgosTask } from '@argos-ci/cypress/task';
import coverage from '@cypress/code-coverage/task.js';
import { defineConfig } from 'cypress';
import { addMatchImageSnapshotPlugin } from 'cypress-image-snapshot/plugin.js';
import cypressSplit from 'cypress-split';
export default eyesPlugin(
defineConfig({
projectId: 'n2sma2',
viewportWidth: 1440,
viewportHeight: 1024,
e2e: {
specPattern: 'cypress/integration/**/*.{js,ts}',
setupNodeEvents(on, config) {
coverage(on, config);
cypressSplit(on, config);
on('before:browser:launch', (browser, launchOptions) => {
if (browser.name === 'chrome' && browser.isHeadless) {
launchOptions.args.push('--window-size=1440,1024', '--force-device-scale-factor=1');
}
return launchOptions;
});
// copy any needed variables from process.env to config.env
config.env.useAppli = process.env.USE_APPLI ? true : false;
config.env.useArgos = process.env.RUN_VISUAL_TEST === 'true';
if (config.env.useArgos) {
registerArgosTask(on, config);
} else {
addMatchImageSnapshotPlugin(on, config);
}
// do not forget to return the changed config object!
return config;
},
},
video: false,
})
);