@@ -55,26 +55,17 @@ describe('isInternalToAdobeRuntime', () => {
5555 } )
5656
5757 test ( 'in runtime context' , ( ) => {
58- process . env . __OW_NAMESPACE = 'some-namespace'
59- process . env . __OW_API_HOST = 'some-server-dot-com'
60- process . env . __OW_ACTIVATION_ID = 'some-activation-id'
61-
58+ process . env . __OW_CLOUD = 'aws'
6259 expect ( isInternalToAdobeRuntime ( ) ) . toBeTruthy ( )
6360 } )
6461
6562 test ( 'not in runtime context' , ( ) => {
66- // make doubly sure the env vars are not there
67- delete process . env . __OW_NAMESPACE
68- delete process . env . __OW_API_HOST
69- delete process . env . __OW_ACTIVATION_ID
70-
63+ process . env . __OW_CLOUD = undefined
7164 expect ( isInternalToAdobeRuntime ( ) ) . toBeFalsy ( )
7265 } )
7366
7467 test ( 'in runtime context - endpoints should be internal' , ( ) => {
75- process . env . __OW_NAMESPACE = 'some-namespace'
76- process . env . __OW_API_HOST = 'some-server-dot-com'
77- process . env . __OW_ACTIVATION_ID = 'some-activation-id'
68+ process . env . __OW_CLOUD = 'aws'
7869
7970 expect ( isInternalToAdobeRuntime ( ) ) . toBeTruthy ( )
8071 jest . isolateModules ( ( ) => {
@@ -85,10 +76,7 @@ describe('isInternalToAdobeRuntime', () => {
8576 } )
8677
8778 test ( 'not in runtime context - endpoints should be public' , ( ) => {
88- // make doubly sure the env vars are not there
89- delete process . env . __OW_NAMESPACE
90- delete process . env . __OW_API_HOST
91- delete process . env . __OW_ACTIVATION_ID
79+ process . env . __OW_CLOUD = undefined
9280
9381 expect ( isInternalToAdobeRuntime ( ) ) . toBeFalsy ( )
9482 jest . isolateModules ( ( ) => {
@@ -97,6 +85,17 @@ describe('isInternalToAdobeRuntime', () => {
9785 expect ( constants . ENDPOINTS . stage ) . toEqual ( constants . ENDPOINT_STAGE )
9886 } )
9987 } )
88+
89+ test ( 'in runtime context - endpoints should be internal (ensure order of tests does not matter)' , ( ) => {
90+ process . env . __OW_CLOUD = 'aws'
91+
92+ expect ( isInternalToAdobeRuntime ( ) ) . toBeTruthy ( )
93+ jest . isolateModules ( ( ) => {
94+ const constants = require ( '../lib/constants' )
95+ expect ( constants . ENDPOINTS . prod ) . toEqual ( constants . ENDPOINT_PROD_INTERNAL )
96+ expect ( constants . ENDPOINTS . stage ) . toEqual ( constants . ENDPOINT_STAGE_INTERNAL )
97+ } )
98+ } )
10099} )
101100
102101describe ( 'formatAjvErrors' , ( ) => {
0 commit comments