mirror of
https://github.com/linux-odyssey/linux-odyssey.git
synced 2026-11-08 19:40:11 +08:00
fix: issue #96
This commit is contained in:
1 parent
4b9c7de031
commit
af088730e8
2 files changed
+6
-6
No files matched your search
@@ -6,8 +6,8 @@ const getConfig = (key, defaultValue) => {
|
|||||||
return process.env[key] || defaultValue
|
return process.env[key] || defaultValue
|
||||||
}
|
}
|
||||||
|
|
||||||
const getOrFail = (key, defaultValue=undefined) => {
|
const getOrFail = (key) => {
|
||||||
const value = getConfig(key, defaultValue)
|
const value = getConfig(key)
|
||||||
if (!value) {
|
if (!value) {
|
||||||
throw new Error(`Missing required environment variable ${key}`)
|
throw new Error(`Missing required environment variable ${key}`)
|
||||||
}
|
}
|
||||||
@@ -25,8 +25,8 @@ module.exports = defineConfig({
|
|||||||
retries: { runMode: 5, openMode: 5 },
|
retries: { runMode: 5, openMode: 5 },
|
||||||
},
|
},
|
||||||
env: {
|
env: {
|
||||||
defaultAccount: getOrFail('TESTING_USERNAME', 'alex'),
|
defaultAccount: getOrFail('TESTING_USERNAME'),
|
||||||
defaultPassword: getOrFail('TESTING_PASSWORD', 'Alex1234'),
|
defaultPassword: getOrFail('TESTING_PASSWORD'),
|
||||||
isCHVersion: true,
|
isCHVersion: true,
|
||||||
// google_username: process.env.GOOGLE_USERNAME,
|
// google_username: process.env.GOOGLE_USERNAME,
|
||||||
// google_password: process.env.GOOGLE_PASSWORD,
|
// google_password: process.env.GOOGLE_PASSWORD,
|
||||||
|
|||||||
+2
-2
@@ -5,8 +5,8 @@
|
|||||||
"main": "index.js",
|
"main": "index.js",
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"test": "cypress run",
|
"test": "export TESTING_USERNAME=alex && export TESTING_PASSWORD=Alex1234 && cypress run",
|
||||||
"test:open": "cypress open"
|
"test:open": "export TESTING_USERNAME=alex && export TESTING_PASSWORD=Alex1234 && cypress open"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@testing-library/cypress": "^10.0.1",
|
"@testing-library/cypress": "^10.0.1",
|
||||||
|
|||||||
Reference in new issue
Block a user