Skip to content

Commit

Permalink
chore: add cypress env commands (5afe#3752)
Browse files Browse the repository at this point in the history
* chore: add cypress env commands

* test: define env for Cypress testing

* fix: use fallback

* fix: destructure env

* fix: modify script to accept optional env arg
  • Loading branch information
iamacook authored Apr 8, 2022
1 parent 87c1ab3 commit 846be31
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 2 deletions.
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,8 @@
"update-mocks": "./scripts/update-mocks.sh",
"sentry-upload-sourcemaps": "sentry-cli --auth-token $SENTRY_AUTH_TOKEN releases -o $SENTRY_ORG -p $SENTRY_PROJECT files $npm_package_version upload-sourcemaps ./build/static/js/",
"prepare": "husky install",
"cypress:open": "cypress open",
"cypress:run": "cypress run"
"cypress:open": "node ./scripts/cypress.js open",
"cypress:run": "node ./scripts/cypress.js run"
},
"lint-staged": {
"src/**/*.{js,jsx,ts,tsx}": [
Expand Down
12 changes: 12 additions & 0 deletions scripts/cypress.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
const { exec } = require('child_process')

const DEPLOYMENTS = {
dev: 'https://safe-team.dev.gnosisdev.com/app',
staging: 'https://safe-team.staging.gnosisdev.com/app',
prod: 'https://gnosis-safe.io/app',
}

const command = `cypress ${process.argv[2]}`
const env = process.argv?.[3]

exec(env ? `${command} --config baseUrl=${DEPLOYMENTS[env]}` : command)

0 comments on commit 846be31

Please sign in to comment.