feat: cypress accept baseUrl from env

This commit is contained in:
Lin, Hung-Shin committed 2023-09-28 13:27:46 +08:00
1 parent 94e8940369
commit a6ffd6b037
4 files changed
+12 -5

No files matched your search

+6 -3
View File
@@ -1,9 +1,12 @@
const { defineConfig } = require('cypress')
const process = require('process')
const getConfig = (key, defaultValue) => {
return process.env[key] || defaultValue
}
module.exports = defineConfig({
e2e: {
setupNodeEvents(on, config) {
// implement node event listeners here
},
baseUrl: getConfig('BASE_URL', 'http://localhost:5173'),
},
})