Files
MSE-SoftwEng/web-app/cypress.unit.js
2025-06-08 22:31:46 +02:00

41 lines
1.1 KiB
JavaScript

const { defineConfig } = require('cypress');
module.exports = defineConfig({
// Shared settings for all test types
watchForFileChanges: false,
screenshotOnRunFailure: false,
video: false,
defaultCommandTimeout: 10000,
chromeWebSecurity: false,
retries: {
runMode: 2,
openMode: 0,
},
// E2E test configuration
e2e: {
specPattern: ['tests/e2e/*.spec.ts', 'tests/unit/*.spec.ts'],
baseUrl: null, // No baseUrl to prevent server checks in headless mode
supportFile: 'tests/support/e2e.ts',
experimentalRunAllSpecs: true,
testIsolation: false, // Allow shared context for unit tests
setupNodeEvents(on, config) {
// Disable baseUrl verification for headless testing
on('before:browser:launch', (browser, launchOptions) => {
return launchOptions;
});
return config;
},
},
// Component test configuration (for Vue components)
component: {
devServer: {
framework: 'vue',
bundler: 'webpack',
},
specPattern: 'tests/unit/*.spec.ts', // Component tests are in unit directory
supportFile: 'tests/support/e2e.ts',
},
});