Skip to content
This repository was archived by the owner on Apr 1, 2020. It is now read-only.

Commit 98f2138

Browse files
committed
test: dummy test starter
1 parent d019333 commit 98f2138

File tree

1 file changed

+33
-0
lines changed

1 file changed

+33
-0
lines changed

test/bot.test.js

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
// Packages
2+
const expect = require('expect')
3+
const { createRobot } = require('probot')
4+
5+
// Ours
6+
const app = require('../index')
7+
const githubMock = require('./mocks/github')
8+
const payload = require('./payload')
9+
10+
describe('commitlint-bot', () => {
11+
let robot
12+
let github
13+
14+
beforeEach(() => {
15+
// Here we create a robot instance
16+
robot = createRobot()
17+
// Here we initialize the app on the robot instance
18+
app(robot)
19+
// Mock GitHub client
20+
github = githubMock()
21+
// Passes the mocked out GitHub API into out robot instance
22+
robot.auth = () => Promise.resolve(github)
23+
})
24+
25+
describe('update status to pending', () => {
26+
it('calls createStatus with "pending"', async () => {
27+
// Simulates delivery of a payload
28+
await robot.receive(payload.opened)
29+
// expect(github.repos.createStatus).toHaveBeenCalled()
30+
expect(true).toBeTruthy()
31+
})
32+
})
33+
})

0 commit comments

Comments
 (0)