From b99d0d48e9e5e4dc651bc894304a05f1339f0efd Mon Sep 17 00:00:00 2001 From: nivedin Date: Tue, 17 Oct 2023 13:21:09 +0530 Subject: [PATCH] fix: update global environment in test --- .../hoppscotch-common/src/helpers/RequestRunner.ts | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/packages/hoppscotch-common/src/helpers/RequestRunner.ts b/packages/hoppscotch-common/src/helpers/RequestRunner.ts index 7d1f3a9b3..93e0bba8d 100644 --- a/packages/hoppscotch-common/src/helpers/RequestRunner.ts +++ b/packages/hoppscotch-common/src/helpers/RequestRunner.ts @@ -131,10 +131,15 @@ export function runRESTRequest$( tab.value.document.testResults = translateToSandboxTestResults( runResult.right ) - - setGlobalEnvVariables(runResult.right.envs.global) - if ( + environmentsStore.value.selectedEnvironmentIndex.type === + "NO_ENV_SELECTED" + ) { + setGlobalEnvVariables([ + ...runResult.right.envs.global, + ...runResult.right.envs.selected, + ]) + } else if ( environmentsStore.value.selectedEnvironmentIndex.type === "MY_ENV" ) { const env = getEnvironment({