Skip to content

Commit

Permalink
test: break tests when unexpected reqs are made
Browse files Browse the repository at this point in the history
  • Loading branch information
phillipj committed Aug 31, 2016
1 parent 7042745 commit e2bf71b
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions test/integration/node-labels-webhook.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,14 @@ tap.test('Sends POST request to https://api.github.com/repos/nodejs/node/issues/
t.plan(1)
t.tearDown(() => filesScope.done() && newLabelsScope.done())

nock.emitter.on('no match', (req) => {
// requests against the app is expected and we shouldn't need to tell nock about it
if (req.hostname === '127.0.0.1') return

const reqUrl = `${req._headers.host}${req.path}`
t.bailout(`Unexpected request was sent to ${reqUrl}`)
})

supertest(app)
.post('/hooks/github')
.set('x-github-event', 'pull_request')
Expand Down

0 comments on commit e2bf71b

Please sign in to comment.