-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcypress.config.js
41 lines (38 loc) · 923 Bytes
/
cypress.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
import { defineConfig } from "cypress";
import webpackPreprocessor from "@cypress/webpack-preprocessor";
export default defineConfig({
e2e: {
experimentalRunAllSpecs: true,
chromeWebSecurity: false,
setupNodeEvents(on) {
const options = webpackPreprocessor.defaultOptions;
if (!options.module) {
options.module = {
rules: [],
}
}
if (!options.module.rules) {
options.module.rules = [];
}
options.module.rules.push({
test: /\.(js|jsx|mjs)$/,
exclude: [/node_modules\/(?!(@onehat)\/).*/],
use: [{
loader: 'babel-loader',
options: {
cacheDirectory: false,
presets: [
'@babel/preset-env'
],
plugins: [
'@babel/plugin-transform-class-properties',
'@babel/plugin-transform-runtime'
],
sourceType: 'unambiguous',
},
}],
});
on('file:preprocessor', webpackPreprocessor(options));
},
}
});