From 81d8c30d8484678dc627b2a76d790c6c95faa1ea Mon Sep 17 00:00:00 2001 From: Sergei Karetnikov Date: Fri, 13 Sep 2024 08:18:05 +0200 Subject: [PATCH] feat(usebruno#2441): Set response body function (#3076) --- packages/bruno-js/src/bruno-response.js | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/packages/bruno-js/src/bruno-response.js b/packages/bruno-js/src/bruno-response.js index 57e11a646..9e68045d9 100644 --- a/packages/bruno-js/src/bruno-response.js +++ b/packages/bruno-js/src/bruno-response.js @@ -27,6 +27,15 @@ class BrunoResponse { getResponseTime() { return this.res ? this.res.responseTime : null; } + + setBody(data) { + if (!this.res) { + return; + } + + this.body = data; + this.res.data = data; + } } module.exports = BrunoResponse;