forked from resoluteCoder/edge-frontend
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcypress.config.js
More file actions
34 lines (28 loc) · 830 Bytes
/
cypress.config.js
File metadata and controls
34 lines (28 loc) · 830 Bytes
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
const { defineConfig } = require("cypress");
// eslint-disable-next-line no-unused-vars
const fs = require("fs-extra");
const path = require("path");
function getConfigurationByFile(file) {
const pathToConfigFile = path.resolve("cypress/config", `${file}.env.json`);
// check if file exists
if (!fs.existsSync(pathToConfigFile)) {
throw new Error(`Config file ${pathToConfigFile} does not exist`);
}
return fs.readJson(pathToConfigFile);
}
module.exports = defineConfig({
chromeWebSecurity: false,
e2e: {
setupNodeEvents(on, config) {
// accept a configFile value or use local by default
const file = config.env.configFile || "local";
return getConfigurationByFile(file);
},
},
component: {
devServer: {
framework: "react",
bundler: "webpack",
},
},
});