@@ -191,7 +191,7 @@ describe('constructContext function', () => {
191
191
expect ( typeof context . getTwilioClient ) . toBe ( 'function' ) ;
192
192
} ) ;
193
193
194
- test ( 'overrides existing PATH' , ( ) => {
194
+ test ( 'does not override existing PATH values ' , ( ) => {
195
195
const env : EnvironmentVariablesWithAuth = {
196
196
ACCOUNT_SID : 'ACxxxxxxxxxxx' ,
197
197
AUTH_TOKEN : 'xyz' ,
@@ -203,11 +203,22 @@ describe('constructContext function', () => {
203
203
env,
204
204
} as StartCliConfig ;
205
205
const context = constructContext ( config , '/test2' ) ;
206
- expect ( context . DOMAIN_NAME ) . toBe ( 'localhost:8000' ) ;
207
- expect ( context . PATH ) . toBe ( '/test2' ) ;
208
- expect ( context . ACCOUNT_SID ) . toBe ( 'ACxxxxxxxxxxx' ) ;
209
- expect ( context . AUTH_TOKEN ) . toBe ( 'xyz' ) ;
210
- expect ( typeof context . getTwilioClient ) . toBe ( 'function' ) ;
206
+ expect ( context . PATH ) . toBe ( '/usr/bin:/bin' ) ;
207
+ } ) ;
208
+
209
+ test ( 'does not override existing DOMAIN_NAME values' , ( ) => {
210
+ const env : EnvironmentVariablesWithAuth = {
211
+ ACCOUNT_SID : 'ACxxxxxxxxxxx' ,
212
+ AUTH_TOKEN : 'xyz' ,
213
+ DOMAIN_NAME : 'hello.world' ,
214
+ } ;
215
+
216
+ const config = {
217
+ url : 'http://localhost:8000' ,
218
+ env,
219
+ } as StartCliConfig ;
220
+ const context = constructContext ( config , '/test2' ) ;
221
+ expect ( context . DOMAIN_NAME ) . toBe ( 'hello.world' ) ;
211
222
} ) ;
212
223
213
224
test ( 'getTwilioClient calls twilio constructor' , ( ) => {
0 commit comments