Skip to content

Commit 4338e18

Browse files
committed
fix: Replace url with webhookUrl for _addWebhook
1 parent 46bb958 commit 4338e18

File tree

2 files changed

+15
-15
lines changed

2 files changed

+15
-15
lines changed

index.js

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -214,10 +214,10 @@ class BitbucketScm extends Scm {
214214
* is instead updated.
215215
* @method _addWebhook
216216
* @param {Object} config
217-
* @param {String} config.scmUri The SCM URI to add the webhook to
218-
* @param {String} config.token Oauth2 token to authenticate with Bitbucket
219-
* @param {String} config.url The URL to use for webhook notifications
220-
* @return {Promise} Resolves upon success
217+
* @param {String} config.scmUri The SCM URI to add the webhook to
218+
* @param {String} config.token Oauth2 token to authenticate with Bitbucket
219+
@param {String} config.webhookUrl The URL to use for the webhook notifications
220+
* @return {Promise} Resolves upon success
221221
*/
222222
_addWebhook(config) {
223223
const repoInfo = getScmUriParts(config.scmUri);
@@ -226,14 +226,14 @@ class BitbucketScm extends Scm {
226226
page: 1,
227227
repoId: repoInfo.repoId,
228228
token: config.token,
229-
url: config.url
229+
url: config.webhookUrl
230230
})
231231
.then(hookInfo =>
232232
this._createWebhook({
233233
hookInfo,
234234
repoId: repoInfo.repoId,
235235
token: config.token,
236-
url: config.url
236+
url: config.webhookUrl
237237
})
238238
);
239239
}

test/index.test.js

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1332,7 +1332,7 @@ describe('index', function () {
13321332
});
13331333
});
13341334

1335-
describe('_addWebhook', () => {
1335+
describe.only('_addWebhook', () => {
13361336
const oauthToken = 'oauthToken';
13371337
const scmUri = 'hostName:repoId:branchName';
13381338

@@ -1356,7 +1356,7 @@ describe('index', function () {
13561356
/* eslint-enable no-underscore-dangle */
13571357
scmUri,
13581358
token: oauthToken,
1359-
url: 'url'
1359+
webhookUrl: 'url'
13601360
})
13611361
.then(() => {
13621362
assert.calledWith(requestMock, {
@@ -1411,7 +1411,7 @@ describe('index', function () {
14111411
/* eslint-enable no-underscore-dangle */
14121412
scmUri,
14131413
token: oauthToken,
1414-
url: 'url'
1414+
webhookUrl: 'url'
14151415
}).then(() => {
14161416
assert.calledWith(requestMock, {
14171417
json: true,
@@ -1479,7 +1479,7 @@ describe('index', function () {
14791479
/* eslint-enable no-underscore-dangle */
14801480
scmUri,
14811481
token: oauthToken,
1482-
url: 'url'
1482+
webhookUrl: 'url'
14831483
}).then(() => {
14841484
assert.calledWith(requestMock, {
14851485
json: true,
@@ -1538,7 +1538,7 @@ describe('index', function () {
15381538
/* eslint-enable no-underscore-dangle */
15391539
scmUri,
15401540
token,
1541-
url: 'url'
1541+
webhookUrl: 'url'
15421542
}).then(assert.fail, (err) => {
15431543
assert.strictEqual(err.message, expectedMessage);
15441544
});
@@ -1558,7 +1558,7 @@ describe('index', function () {
15581558
/* eslint-enable no-underscore-dangle */
15591559
scmUri,
15601560
token,
1561-
url: 'url'
1561+
webhookUrl: 'url'
15621562
}).then(assert.fail, (err) => {
15631563
assert.strictEqual(err.message, expectedMessage);
15641564
});
@@ -1593,7 +1593,7 @@ describe('index', function () {
15931593
/* eslint-enable no-underscore-dangle */
15941594
scmUri,
15951595
token,
1596-
url: 'url'
1596+
webhookUrl: 'url'
15971597
}).then(assert.fail, (err) => {
15981598
assert.strictEqual(err.message, [
15991599
'Your credentials lack one or more required privilege scopes.',
@@ -1638,7 +1638,7 @@ describe('index', function () {
16381638
/* eslint-enable no-underscore-dangle */
16391639
scmUri,
16401640
token,
1641-
url: 'url'
1641+
webhookUrl: 'url'
16421642
}).then(assert.fail, (err) => {
16431643
assert.strictEqual(err.message, expectedMessage);
16441644
});
@@ -1668,7 +1668,7 @@ describe('index', function () {
16681668
/* eslint-enable no-underscore-dangle */
16691669
scmUri,
16701670
token,
1671-
url: 'url'
1671+
webhookUrl: 'url'
16721672
}).then(assert.fail, (err) => {
16731673
assert.strictEqual(err.message, expectedMessage);
16741674
});

0 commit comments

Comments
 (0)