From 56ea312970e701f771844180b2b93ea0def61836 Mon Sep 17 00:00:00 2001 From: Rhys Arkins <rhys@arkins.net> Date: Tue, 9 Apr 2019 14:51:56 +0200 Subject: [PATCH] fix(bitbucket): createPr return number, not id --- lib/platform/bitbucket/index.js | 2 +- test/platform/bitbucket/index.spec.js | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/platform/bitbucket/index.js b/lib/platform/bitbucket/index.js index 84dd11ddc9..3aed5de408 100644 --- a/lib/platform/bitbucket/index.js +++ b/lib/platform/bitbucket/index.js @@ -467,7 +467,7 @@ async function createPr( `/2.0/repositories/${config.repository}/pullrequests`, { body } )).body; - const pr = { id: prInfo.id, displayNumber: `Pull Request #${prInfo.id}` }; + const pr = { number: prInfo.id, displayNumber: `Pull Request #${prInfo.id}` }; // istanbul ignore if if (config.prList) { config.prList.push(pr); diff --git a/test/platform/bitbucket/index.spec.js b/test/platform/bitbucket/index.spec.js index daddc1e73b..8a00fd2e15 100644 --- a/test/platform/bitbucket/index.spec.js +++ b/test/platform/bitbucket/index.spec.js @@ -323,8 +323,8 @@ describe('platform/bitbucket', () => { api.post.mockReturnValueOnce({ body: { id: 5 }, }); - const { id } = await bitbucket.createPr('branch', 'title', 'body'); - expect(id).toBe(5); + const { number } = await bitbucket.createPr('branch', 'title', 'body'); + expect(number).toBe(5); expect(api.post.mock.calls).toMatchSnapshot(); }); }); -- GitLab