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 67568ed commit d33f49cCopy full SHA for d33f49c
test/unit/bot-username.test.js
@@ -0,0 +1,23 @@
1
+'use strict'
2
+
3
+const proxyquire = require('proxyquire')
4
+const sinon = require('sinon')
5
+const tap = require('tap')
6
7
+const githubClient = require('../../lib/github-client')
8
9
+tap.test('botUsername.resolve(): returns username of current user', (t) => {
10
+ sinon.stub(githubClient.users, 'get').yields(null, { login: 'nodejs-github-bot' })
11
+ const botUsername = proxyquire('../../lib/bot-username', {
12
+ './github-client': githubClient
13
+ })
14
15
+ t.plan(1)
16
+ t.tearDown(() => {
17
+ githubClient.users.get.restore()
18
19
20
+ botUsername.resolve((_, username) => {
21
+ t.same(username, 'nodejs-github-bot')
22
23
+})
0 commit comments