forked from FarmData2/FarmData2
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.cypress.module.config.js
74 lines (73 loc) · 1.92 KB
/
.cypress.module.config.js
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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
import { defineConfig } from 'cypress';
import { execSync } from 'child_process';
import vitePreprocessor from 'cypress-vite';
export default defineConfig({
screenshotOnRunFailure: false,
video: false,
trashAssetsBeforeRuns: true,
chromeWebSecurity: false,
defaultCommandTimeout: 10000,
e2e: {
supportFile: '../../cypress/support/e2e.js',
specPattern: 'src/entrypoints/*/*.e2e.cy.js',
devServer: {
framework: 'vue',
bundler: 'vite',
},
setupNodeEvents(on, config) {
on(
'file:preprocessor',
vitePreprocessor({
configFile: config.env.module + '/vite.config.e2e.js',
mode: 'development',
})
);
on('task', {
log(message) {
console.log(message);
return null;
},
logObject(obj) {
console.log(JSON.stringify(obj, null, 2));
return null;
},
initDB() {
execSync('installDB.bash --current', { stdio: 'inherit' });
return null;
},
}),
on('before:run', () => {
execSync('installDB.bash --current', { stdio: 'inherit' });
return null;
});
},
},
component: {
supportFile: '../../cypress/support/component.js',
indexHtmlFile: '../../cypress/support/component-index.html',
specPattern: 'src/entrypoints/*/*.unit.cy.js',
devServer: {
bundler: 'vite',
},
setupNodeEvents(on) {
on('task', {
log(message) {
console.log(message);
return null;
},
logObject(obj) {
console.log(JSON.stringify(obj, null, 2));
return null;
},
initDB() {
execSync('installDB.bash --current', { stdio: 'inherit' });
return null;
},
}),
on('before:run', () => {
execSync('installDB.bash --current', { stdio: 'inherit' });
return null;
});
},
},
});