-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcypress.config.js
More file actions
43 lines (40 loc) · 1.03 KB
/
cypress.config.js
File metadata and controls
43 lines (40 loc) · 1.03 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
35
36
37
38
39
40
41
42
43
import { defineConfig } from "cypress";
import webpackPreprocessor from "@cypress/webpack-preprocessor";
import localstoragePlugin from 'cypress-localstorage-commands/plugin.js';
export default defineConfig({
e2e: {
experimentalRunAllSpecs: true,
chromeWebSecurity: false,
setupNodeEvents(on, config) {
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));
localstoragePlugin(on, config);
},
}
});