-
-
Notifications
You must be signed in to change notification settings - Fork 129
Expand file tree
/
Copy pathcypress.config.js
More file actions
34 lines (32 loc) · 1.06 KB
/
Copy pathcypress.config.js
File metadata and controls
34 lines (32 loc) · 1.06 KB
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
import { defineConfig } from 'cypress';
import fs from 'fs';
import viteConfig from './vite.config.cypress.js';
export default defineConfig({
component: {
devServer: {
framework: 'vue',
bundler: 'vite',
viteConfig,
},
setupNodeEvents(on, config) {
on('task', {
clearDownloads() {
const downloadsFolder = 'cypress/downloads';
try {
fs.readdirSync(downloadsFolder).forEach((file) => {
const filePath = `${downloadsFolder}/${file}`;
fs.unlinkSync(filePath);
});
console.log('Downloads folder cleared.');
return null;
} catch (err) {
console.error(
`Error clearing downloads folder: ${err}`,
);
return err;
}
},
});
},
},
});