-
Notifications
You must be signed in to change notification settings - Fork 0
/
cypress.config.ts
42 lines (41 loc) · 1.16 KB
/
cypress.config.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
import { defineConfig } from 'cypress';
import { devServer } from '@cypress/vite-dev-server';
import del from 'del';
export default defineConfig({
component: {
specPattern: 'cypress/component/**/*.spec.{js,jsx,ts,tsx}',
screenshotOnRunFailure: false,
devServer(devServerConfig) {
return devServer({
...devServerConfig,
framework: 'react',
viteConfig: require('./vite.config'),
});
},
setupNodeEvents(on, config) {
// @ts-ignore
on('after:spec', (_, results) => {
if (results.stats.failures === 0 && results.video) {
return del(results.video);
}
});
require('@cypress/code-coverage/task')(on, config);
return config;
},
},
e2e: {
baseUrl: 'http://localhost:6006',
specPattern: 'cypress/e2e/**/*.spec.{js,jsx,ts,tsx}',
screenshotOnRunFailure: false,
setupNodeEvents(on, config) {
// @ts-ignore
on('after:spec', (_, results) => {
if (results.stats.failures === 0 && results.video) {
return del(results.video);
}
});
require('@cypress/code-coverage/task')(on, config);
return config;
},
},
});