From b25d896dd6c06deeb4b14965611d3bb8619dcd1e Mon Sep 17 00:00:00 2001 From: Anoop M D Date: Fri, 1 Sep 2023 17:49:34 +0530 Subject: [PATCH] fix(#178): fixed await issue while running scripts --- packages/bruno-cli/package.json | 2 +- packages/bruno-cli/src/runner/run-single-request.js | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/packages/bruno-cli/package.json b/packages/bruno-cli/package.json index a44a4b63d..ceef82853 100644 --- a/packages/bruno-cli/package.json +++ b/packages/bruno-cli/package.json @@ -1,6 +1,6 @@ { "name": "@usebruno/cli", - "version": "0.6.1", + "version": "0.6.2", "main": "src/index.js", "bin": { "bru": "./bin/bru.js" diff --git a/packages/bruno-cli/src/runner/run-single-request.js b/packages/bruno-cli/src/runner/run-single-request.js index 2697301db..c00b447e3 100644 --- a/packages/bruno-cli/src/runner/run-single-request.js +++ b/packages/bruno-cli/src/runner/run-single-request.js @@ -36,7 +36,7 @@ const runSingleRequest = async function (filename, bruJson, collectionPath, coll const requestScriptFile = get(bruJson, 'request.script.req'); if(requestScriptFile && requestScriptFile.length) { const scriptRuntime = new ScriptRuntime(); - scriptRuntime.runRequestScript(requestScriptFile, request, envVariables, collectionVariables, collectionPath); + await scriptRuntime.runRequestScript(requestScriptFile, request, envVariables, collectionVariables, collectionPath); } // interpolate variables inside request @@ -63,7 +63,7 @@ const runSingleRequest = async function (filename, bruJson, collectionPath, coll const responseScriptFile = get(bruJson, 'request.script.res'); if(responseScriptFile && responseScriptFile.length) { const scriptRuntime = new ScriptRuntime(); - scriptRuntime.runResponseScript(responseScriptFile, request, response, envVariables, collectionVariables, collectionPath); + await scriptRuntime.runResponseScript(responseScriptFile, request, response, envVariables, collectionVariables, collectionPath); } // run assertions @@ -121,7 +121,7 @@ const runSingleRequest = async function (filename, bruJson, collectionPath, coll const responseScriptFile = get(bruJson, 'request.script.res'); if(responseScriptFile && responseScriptFile.length) { const scriptRuntime = new ScriptRuntime(); - scriptRuntime.runResponseScript(responseScriptFile, request, err.response, envVariables, collectionVariables, collectionPath); + await scriptRuntime.runResponseScript(responseScriptFile, request, err.response, envVariables, collectionVariables, collectionPath); } // run assertions