From a76629341ce471c72e21ee453a91a72e5cc71443 Mon Sep 17 00:00:00 2001 From: Tiffany Kyi Date: Thu, 26 Jul 2018 11:59:33 -0700 Subject: [PATCH] fix: Update to hapiv17 --- package.json | 2 +- test/index.test.js | 40 ++++++++++++++++++++-------------------- 2 files changed, 21 insertions(+), 21 deletions(-) diff --git a/package.json b/package.json index 22cafd2..f2aa192 100644 --- a/package.json +++ b/package.json @@ -35,7 +35,7 @@ "chai": "^3.5.0", "eslint": "^3.9.1", "eslint-config-screwdriver": "^2.0.9", - "hapi": "^16.1.0", + "hapi": "^17.0.0", "jenkins-mocha": "^4.1.1", "mockery": "^2.0.0", "sinon": "^1.17.7" diff --git a/test/index.test.js b/test/index.test.js index 76b7be1..57a5f66 100644 --- a/test/index.test.js +++ b/test/index.test.js @@ -75,8 +75,8 @@ describe('index', () => { it('verifies that included status creates nodemailer transporter', (done) => { serverMock.event(eventMock); - serverMock.on(eventMock, data => notifier.notify(data)); - serverMock.emit(eventMock, buildDataMock); + serverMock.events.on(eventMock, data => notifier.notify(data)); + serverMock.events.emit(eventMock, buildDataMock); process.nextTick(() => { assert.calledWith(nodemailerMock.createTransport, @@ -92,8 +92,8 @@ describe('index', () => { notifier = new EmailNotifier(configMock, serverMock, 'build_status_test'); serverMock.event(eventMock); - serverMock.on(eventMock, data => notifier.notify(data)); - serverMock.emit(eventMock, buildDataMock); + serverMock.events.on(eventMock, data => notifier.notify(data)); + serverMock.events.emit(eventMock, buildDataMock); process.nextTick(() => { assert.calledWith(nodemailerMock.createTransport, @@ -121,8 +121,8 @@ describe('index', () => { }; serverMock.event(eventMock); - serverMock.on(eventMock, data => notifier.notify(data)); - serverMock.emit(eventMock, buildDataMockUnincluded); + serverMock.events.on(eventMock, data => notifier.notify(data)); + serverMock.events.emit(eventMock, buildDataMockUnincluded); process.nextTick(() => { assert.notCalled(nodemailerMock.createTransport); @@ -142,8 +142,8 @@ describe('index', () => { }; serverMock.event(eventMock); - serverMock.on(eventMock, data => notifier.notify(data)); - serverMock.emit(eventMock, buildDataMockUnincluded); + serverMock.events.on(eventMock, data => notifier.notify(data)); + serverMock.events.emit(eventMock, buildDataMockUnincluded); process.nextTick(() => { assert.notCalled(nodemailerMock.createTransport); @@ -164,8 +164,8 @@ describe('index', () => { }; serverMock.event(eventMock); - serverMock.on(eventMock, data => notifier.notify(data)); - serverMock.emit(eventMock, buildDataMockSimple); + serverMock.events.on(eventMock, data => notifier.notify(data)); + serverMock.events.emit(eventMock, buildDataMockSimple); process.nextTick(() => { assert.calledWith(nodemailerMock.createTransport, @@ -187,8 +187,8 @@ describe('index', () => { }; serverMock.event(eventMock); - serverMock.on(eventMock, data => notifier.notify(data)); - serverMock.emit(eventMock, buildDataMockArray); + serverMock.events.on(eventMock, data => notifier.notify(data)); + serverMock.events.emit(eventMock, buildDataMockArray); process.nextTick(() => { assert.calledWith(nodemailerMock.createTransport, @@ -204,8 +204,8 @@ describe('index', () => { }; serverMock.event(eventMock); - serverMock.on(eventMock, data => notifier.notify(data)); - serverMock.emit(eventMock, buildDataMock); + serverMock.events.on(eventMock, data => notifier.notify(data)); + serverMock.events.emit(eventMock, buildDataMock); process.nextTick(() => { assert.calledWith(nodemailerMock.createTransport, @@ -338,8 +338,8 @@ describe('index', () => { it('validates status', (done) => { buildDataMock.status = 22; serverMock.event(eventMock); - serverMock.on(eventMock, data => notifier.notify(data)); - serverMock.emit(eventMock, buildDataMock); + serverMock.events.on(eventMock, data => notifier.notify(data)); + serverMock.events.emit(eventMock, buildDataMock); process.nextTick(() => { assert.notCalled(nodemailerMock.createTransport); @@ -350,8 +350,8 @@ describe('index', () => { it('validates settings', (done) => { buildDataMock.settings = ['hello@world.com', 'goodbye@universe.com']; serverMock.event(eventMock); - serverMock.on(eventMock, data => notifier.notify(data)); - serverMock.emit(eventMock, buildDataMock); + serverMock.events.on(eventMock, data => notifier.notify(data)); + serverMock.events.emit(eventMock, buildDataMock); process.nextTick(() => { assert.notCalled(nodemailerMock.createTransport); @@ -363,8 +363,8 @@ describe('index', () => { const buildDataMockInvalid = ['this', 'is', 'wrong']; serverMock.event(eventMock); - serverMock.on(eventMock, data => notifier.notify(data)); - serverMock.emit(eventMock, buildDataMockInvalid); + serverMock.events.on(eventMock, data => notifier.notify(data)); + serverMock.events.emit(eventMock, buildDataMockInvalid); process.nextTick(() => { assert.notCalled(nodemailerMock.createTransport);