-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathcypress.config.ts
58 lines (55 loc) · 1.49 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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
/* eslint-disable no-console */
import { defineConfig } from 'cypress'
import vue from '@vitejs/plugin-vue'
import vueJsx from '@vitejs/plugin-vue-jsx'
import sucrase from '@rollup/plugin-sucrase'
import createBundler from '@bahmutov/cypress-esbuild-preprocessor'
export default defineConfig({
projectId: '89d3nq',
fixturesFolder: false,
component: {
retries: {
runMode: 2,
openMode: 0,
},
setupNodeEvents(on) {
on('task', {
'a11y-table': function (message) {
console.table(message)
return null
},
})
},
devServer: {
framework: 'vue',
bundler: 'vite',
viteConfig: {
plugins: [
vue(),
vueJsx({
exclude: '**/react/**/*',
}),
// to allow for both react and vue JSX to be used we do not use esbuild to compile JSX,
// we use sucrase (about as fast)
sucrase({
jsxPragma: 'React.createElement',
jsxFragmentPragma: 'React.Fragment',
disableESTransforms: true,
enableLegacyBabel5ModuleInterop: false,
enableLegacyTypeScriptModuleInterop: false,
production: false,
transforms: ['typescript', 'jsx'],
include: ['**/*.tsx'],
exclude: '**/vue/**/*',
}),
],
},
},
},
e2e: {
baseUrl: 'http://localhost:5173/',
setupNodeEvents(on, config) {
on('file:preprocessor', createBundler())
},
},
})