We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 24358e4 commit a859805Copy full SHA for a859805
test/unit/event-handler-on-test.js
@@ -1,3 +1,4 @@
1
+const simple = require('simple-mock')
2
const test = require('tap').test
3
4
const receiverOn = require('../../event-handler/on')
@@ -9,8 +10,11 @@ const state = {
9
10
}
11
12
test('receiver.on with invalid event name', t => {
- t.throws(() => {
13
- receiverOn(state, 'foo', noop)
14
- })
+ simple.mock(console, 'warn').callFn(function () {})
+ receiverOn(state, 'foo', noop)
15
+ t.equals(console.warn.callCount, 1)
16
+ t.equals(console.warn.lastCall.arg, '"foo" is not a known webhook name (https://developer.github.com/v3/activity/events/types/)')
17
+
18
+ simple.restore()
19
t.end()
20
})
0 commit comments