File tree Expand file tree Collapse file tree 4 files changed +17
-11
lines changed Expand file tree Collapse file tree 4 files changed +17
-11
lines changed Original file line number Diff line number Diff line change
1
+ APP_ENV = production
2
+ UPLOAD_URL = https://api-cloud.browserstack.com/automate-frameworks/cypress/upload
3
+ RAILS_HOST = https://api.browserstack.com
4
+ DASHBOARD_URL = https://automate.browserstack.com/dashboard/v2/builds/
5
+ USAGE_REPORTING_URL = https://eds.browserstack.com:443/send_event_cy_internal
Original file line number Diff line number Diff line change 5
5
tests.zip
6
6
package-lock.json
7
7
.nyc_output /
8
+ .env. *
9
+ ! .env.production
Original file line number Diff line number Diff line change 1
1
var config = { } ;
2
- config . env = "prod" ;
3
- var hosts = {
4
- prod : {
5
- uploadUrl : `https://api-cloud.browserstack.com/automate-frameworks/cypress/upload` ,
6
- rails_host : `https://api.browserstack.com`
7
- }
8
- } ;
9
- config . uploadUrl = hosts [ config . env ] . uploadUrl ;
10
- config . rails_host = hosts [ config . env ] . rails_host ;
2
+ config . env = process . env . NODE_ENV || "production" ;
3
+
4
+ // load config based on env
5
+ require ( 'custom-env' ) . env ( config . env )
6
+
7
+ config . uploadUrl = process . env . UPLOAD_URL ;
8
+ config . rails_host = process . env . RAILS_HOST ;
11
9
config . cypress_v1 = `${ config . rails_host } /automate/cypress/v1` ;
12
10
config . buildUrl = `${ config . cypress_v1 } /builds/` ;
13
11
config . buildStopUrl = `${ config . cypress_v1 } /builds/stop/` ;
14
- config . dashboardUrl = `https://automate.browserstack.com/dashboard/v2/builds/` ;
15
- config . usageReportingUrl = `https://eds.browserstack.com:443/send_event_cy_internal` ;
12
+ config . dashboardUrl = process . env . DASHBOARD_URL ;
13
+ config . usageReportingUrl = process . env . USAGE_REPORTING_URL ;
16
14
config . fileName = "tests.zip" ;
17
15
18
16
module . exports = config ;
Original file line number Diff line number Diff line change 31
31
"devDependencies" : {
32
32
"chai" : " ^4.2.0" ,
33
33
"chai-as-promised" : " ^7.1.1" ,
34
+ "custom-env" : " ^2.0.1" ,
34
35
"mocha" : " ^7.1.2" ,
35
36
"nyc" : " ^15.0.1" ,
36
37
"proxyquire" : " ^2.1.3" ,
You can’t perform that action at this time.
0 commit comments