From 30ee472c406a805344aefda56282c1537ca936d6 Mon Sep 17 00:00:00 2001 From: Anoop M D Date: Tue, 26 Sep 2023 22:37:55 +0530 Subject: [PATCH] release(#212): bru cli v0.9.0 --- packages/bruno-cli/changelog.md | 4 ++++ packages/bruno-cli/examples/report.json | 2 +- packages/bruno-cli/package.json | 2 +- packages/bruno-cli/src/commands/run.js | 6 +++--- packages/bruno-cli/src/runner/run-single-request.js | 7 ++++++- 5 files changed, 15 insertions(+), 6 deletions(-) diff --git a/packages/bruno-cli/changelog.md b/packages/bruno-cli/changelog.md index 10045c025..5ba0d6fc3 100644 --- a/packages/bruno-cli/changelog.md +++ b/packages/bruno-cli/changelog.md @@ -1,5 +1,9 @@ # Changelog +## 0.9.0 + +- `--output` flag to collect the results of your API tests + ## 0.8.0 - `--env-var` flag to set environment variables diff --git a/packages/bruno-cli/examples/report.json b/packages/bruno-cli/examples/report.json index b933f43db..3dfa641f2 100644 --- a/packages/bruno-cli/examples/report.json +++ b/packages/bruno-cli/examples/report.json @@ -7,7 +7,7 @@ "passedTests": 0, "failedTests": 0 }, - "requestResults": [ + "results": [ { "request": { "method": "GET", diff --git a/packages/bruno-cli/package.json b/packages/bruno-cli/package.json index c8acd5232..bc3edfc3c 100644 --- a/packages/bruno-cli/package.json +++ b/packages/bruno-cli/package.json @@ -1,6 +1,6 @@ { "name": "@usebruno/cli", - "version": "0.8.0", + "version": "0.9.0", "main": "src/index.js", "bin": { "bru": "./bin/bru.js" diff --git a/packages/bruno-cli/src/commands/run.js b/packages/bruno-cli/src/commands/run.js index b2aaa8ebd..845fbc033 100644 --- a/packages/bruno-cli/src/commands/run.js +++ b/packages/bruno-cli/src/commands/run.js @@ -254,7 +254,7 @@ const handler = async function (argv) { const _isFile = await isFile(filename); let assertionResults = []; let testResults = []; - let requestResults = []; + let testrunResults = []; let bruJsons = []; @@ -308,7 +308,7 @@ const handler = async function (argv) { ); if (result) { - requestResults.push(result); + testrunResults.push(result); const { assertionResults: _assertionResults, testResults: _testResults } = result; assertionResults = assertionResults.concat(_assertionResults); @@ -329,7 +329,7 @@ const handler = async function (argv) { const outputJson = { summary, - requestResults + results: testrunResults }; fs.writeFileSync(outputPath, JSON.stringify(outputJson, null, 2)); diff --git a/packages/bruno-cli/src/runner/run-single-request.js b/packages/bruno-cli/src/runner/run-single-request.js index 3f267fef9..e8f1e6bfe 100644 --- a/packages/bruno-cli/src/runner/run-single-request.js +++ b/packages/bruno-cli/src/runner/run-single-request.js @@ -171,7 +171,12 @@ const runSingleRequest = async function ( } return { - request: request, + request: { + method: request.method, + url: request.url, + headers: request.headers, + data: request.data + }, response: { status: response.status, statusText: response.statusText,