release(#212): bru cli v0.9.0

This commit is contained in:
Anoop M D 2023-09-26 22:37:55 +05:30
parent c7aecbea79
commit 30ee472c40
5 changed files with 15 additions and 6 deletions

View File

@ -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

View File

@ -7,7 +7,7 @@
"passedTests": 0,
"failedTests": 0
},
"requestResults": [
"results": [
{
"request": {
"method": "GET",

View File

@ -1,6 +1,6 @@
{
"name": "@usebruno/cli",
"version": "0.8.0",
"version": "0.9.0",
"main": "src/index.js",
"bin": {
"bru": "./bin/bru.js"

View File

@ -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));

View File

@ -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,