Fix bug introduced in 0.7.3

This commit is contained in:
Brandon Keepers
2017-06-30 15:54:46 -05:00
parent 85cd707c01
commit 201a58a878
3 changed files with 28 additions and 2 deletions

View File

@@ -35,7 +35,7 @@ module.exports = (options = {}) => {
// Forward webhooks to robot
webhook.on('*', event => {
this.log.trace(event, 'webhook received');
logger.trace(event, 'webhook received');
robot.receive(event);
});
@@ -58,6 +58,7 @@ module.exports = (options = {}) => {
return {
server,
robot,
webhook,
start() {
server.listen(options.port);

View File

@@ -0,0 +1,26 @@
const expect = require('expect');
const createProbot = require('..');
describe('Probot', () => {
let probot;
let event;
beforeEach(() => {
probot = createProbot();
// Mock out GitHub App authentication
probot.robot.auth = () => Promise.resolve({});
event = {
event: 'push',
payload: require('./fixtures/webhook/push')
};
});
describe('webhook delivery', () => {
it('forwards webhooks to the robot', async () => {
probot.robot.receive = expect.createSpy();
probot.webhook.emit('*', event);
expect(probot.robot.receive).toHaveBeenCalledWith(event);
});
});
});

View File

@@ -113,7 +113,6 @@ describe('Robot', function () {
});
});
describe('error handling', () => {
it('logs errors throw from handlers', async () => {
const error = new Error('testing');