mirror of
https://github.com/usebruno/bruno.git
synced 2024-11-22 16:03:39 +01:00
fix(#178): fixed await issue while running scripts
This commit is contained in:
parent
08495e7fb5
commit
b25d896dd6
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@usebruno/cli",
|
"name": "@usebruno/cli",
|
||||||
"version": "0.6.1",
|
"version": "0.6.2",
|
||||||
"main": "src/index.js",
|
"main": "src/index.js",
|
||||||
"bin": {
|
"bin": {
|
||||||
"bru": "./bin/bru.js"
|
"bru": "./bin/bru.js"
|
||||||
|
@ -36,7 +36,7 @@ const runSingleRequest = async function (filename, bruJson, collectionPath, coll
|
|||||||
const requestScriptFile = get(bruJson, 'request.script.req');
|
const requestScriptFile = get(bruJson, 'request.script.req');
|
||||||
if(requestScriptFile && requestScriptFile.length) {
|
if(requestScriptFile && requestScriptFile.length) {
|
||||||
const scriptRuntime = new ScriptRuntime();
|
const scriptRuntime = new ScriptRuntime();
|
||||||
scriptRuntime.runRequestScript(requestScriptFile, request, envVariables, collectionVariables, collectionPath);
|
await scriptRuntime.runRequestScript(requestScriptFile, request, envVariables, collectionVariables, collectionPath);
|
||||||
}
|
}
|
||||||
|
|
||||||
// interpolate variables inside request
|
// interpolate variables inside request
|
||||||
@ -63,7 +63,7 @@ const runSingleRequest = async function (filename, bruJson, collectionPath, coll
|
|||||||
const responseScriptFile = get(bruJson, 'request.script.res');
|
const responseScriptFile = get(bruJson, 'request.script.res');
|
||||||
if(responseScriptFile && responseScriptFile.length) {
|
if(responseScriptFile && responseScriptFile.length) {
|
||||||
const scriptRuntime = new ScriptRuntime();
|
const scriptRuntime = new ScriptRuntime();
|
||||||
scriptRuntime.runResponseScript(responseScriptFile, request, response, envVariables, collectionVariables, collectionPath);
|
await scriptRuntime.runResponseScript(responseScriptFile, request, response, envVariables, collectionVariables, collectionPath);
|
||||||
}
|
}
|
||||||
|
|
||||||
// run assertions
|
// run assertions
|
||||||
@ -121,7 +121,7 @@ const runSingleRequest = async function (filename, bruJson, collectionPath, coll
|
|||||||
const responseScriptFile = get(bruJson, 'request.script.res');
|
const responseScriptFile = get(bruJson, 'request.script.res');
|
||||||
if(responseScriptFile && responseScriptFile.length) {
|
if(responseScriptFile && responseScriptFile.length) {
|
||||||
const scriptRuntime = new ScriptRuntime();
|
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
|
// run assertions
|
||||||
|
Loading…
Reference in New Issue
Block a user