diff --git a/index.js b/index.js index 0b93b9d..52abbc3 100644 --- a/index.js +++ b/index.js @@ -1037,9 +1037,7 @@ class BitbucketScm extends Scm { } const response = await this.breaker.runCommand(params); - - // we will have to parse the body since we are sending a normal FORM POST request - const body = JSON.parse(response.body); + const { body } = response; if (response.statusCode !== 200) { throw new Error(`STATUS CODE ${response.statusCode}: ${JSON.stringify(body)}`); diff --git a/test/index.test.js b/test/index.test.js index 15dcf85..efe678e 100644 --- a/test/index.test.js +++ b/test/index.test.js @@ -2213,7 +2213,7 @@ describe('index', function() { beforeEach(() => { const response = { statusCode: 200, - body: JSON.stringify(testPayloadAccessToken) + body: testPayloadAccessToken }; requestMock.resolves(response);