-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcypress.config.ts
38 lines (36 loc) · 1.08 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
import { defineConfig as defineCypressConfig } from 'cypress';
import { defineConfig as defineViteConfig } from 'vite';
const development = process.env.NODE_ENV === 'development';
const extensions = ['.web.tsx', '.tsx', '.web.ts', '.ts', '.web.jsx', '.jsx', '.web.js', '.js', '.css', '.json', '.mjs'];
export default defineCypressConfig({
component: {
devServer: {
framework: 'react',
bundler: 'vite',
viteConfig: defineViteConfig({
clearScreen: true,
define: {
global: 'window',
__DEV__: JSON.stringify(development),
DEV: JSON.stringify(development),
'process.env.NODE_ENV': JSON.stringify(process.env.NODE_ENV)
},
resolve: {
extensions: extensions,
alias: {
'react-native': 'react-native-web'
}
},
optimizeDeps: {
esbuildOptions: {
resolveExtensions: extensions,
jsx: 'automatic',
loader: { '.js': 'jsx' }
}
}
})
}
},
screenshotOnRunFailure: false,
video: false
});