Skip to content

Commit c50b9ac

Browse files
committed
Update webhook test, added exception for this
This commit has two fixes: a. The pull request hook parsing should work test was failing, as it was not expecting the number parameter in plugin_data->github->pull_request We are parsing and sending the pull request number in webhooks.js around line 128 Here, I expect that the source is correct and the test needs to be updated. b. The Step module requires the use of "this" (https://www.npmjs.com/package/step) However JSHint has a problem with that usage of this. JSHint says "Possible strict violation" because we are using this inside something that, as far as it can tell, is not a method. That leads to a fail during npm test. Since the source code must use the Step module, hence added a jshint exception for W040.
1 parent ddf1299 commit c50b9ac

2 files changed

Lines changed: 4 additions & 2 deletions

File tree

lib/index.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@ var User = require('./models').User;
1212

1313
var GITHUB_API_ENDPOINT = 'https://api.github.com';
1414

15+
/* jshint -W040 */
16+
1517
/**
1618
* get_oauth2()
1719
*

test/test_webhooks.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,6 @@ describe('webhooks', function () {
4242
it('should work', function () {
4343
var fx = require('./sample_pull_request.json')
4444
, config = lib.pullRequestJob(fx.pull_request, fx.action)
45-
4645
expect(config).to.eql({
4746
branch: 'master',
4847
deploy: false,
@@ -51,7 +50,8 @@ describe('webhooks', function () {
5150
pull_request: {
5251
user: 'jaredly',
5352
repo: 'petulant-wookie',
54-
sha: 'f65ac3101a45bb9408c0459805b496cb73ae2d5f'
53+
sha: 'f65ac3101a45bb9408c0459805b496cb73ae2d5f',
54+
number: 1
5555
}
5656
}
5757
},

0 commit comments

Comments
 (0)