|
1 | 1 | /* eslint-env node, mocha */
|
2 | 2 | 'use strict';
|
3 | 3 |
|
4 |
| -const expect = require('chai').expect; |
| 4 | +const { expect } = require('chai'); |
5 | 5 | const sinon = require('sinon');
|
6 | 6 | const nock = require('nock');
|
| 7 | +const logger = require('@elastic.io/component-logger')(); |
| 8 | + |
7 | 9 | const send = require('../lib/actions/send.js');
|
8 | 10 | const getMethod = require('../lib/helper/get.js');
|
9 | 11 | const receive = require('../lib/triggers/receive.js');
|
@@ -36,7 +38,7 @@ describe('Test Webhook', () => {
|
36 | 38 | };
|
37 | 39 | self = sinon.spy(emitter, 'emit');
|
38 | 40 | send.process.call(
|
39 |
| - { emit: self }, { |
| 41 | + { emit: self, logger }, { |
40 | 42 | body: {
|
41 | 43 | k1: 'v1',
|
42 | 44 | k2: 'v2'
|
@@ -77,7 +79,7 @@ describe('Test Webhook', () => {
|
77 | 79 | };
|
78 | 80 | self = sinon.spy(emitter, 'emit');
|
79 | 81 | send.process.call(
|
80 |
| - { emit: self }, { |
| 82 | + { emit: self, logger }, { |
81 | 83 | body: {
|
82 | 84 | k1: 'v1',
|
83 | 85 | k2: 'v2'
|
@@ -117,7 +119,7 @@ describe('Test Webhook', () => {
|
117 | 119 | };
|
118 | 120 | self = sinon.spy(emitter, 'emit');
|
119 | 121 | send.process.call(
|
120 |
| - { emit: self }, { |
| 122 | + { emit: self, logger }, { |
121 | 123 | body: {
|
122 | 124 | k1: 'v1',
|
123 | 125 | k2: 'v2'
|
@@ -152,7 +154,7 @@ describe('Test Webhook', () => {
|
152 | 154 | };
|
153 | 155 | self = sinon.spy(emitter, 'emit');
|
154 | 156 | getMethod.process.call(
|
155 |
| - { emit: self }, { |
| 157 | + { emit: self, logger }, { |
156 | 158 | body: {
|
157 | 159 | k1: 'v1',
|
158 | 160 | k2: 'v2'
|
@@ -190,7 +192,7 @@ describe('Test Webhook', () => {
|
190 | 192 | };
|
191 | 193 | self = sinon.spy(emitter, 'emit');
|
192 | 194 | getMethod.process.call(
|
193 |
| - { emit: self }, { |
| 195 | + { emit: self, logger }, { |
194 | 196 | body: {
|
195 | 197 | k1: 'v1',
|
196 | 198 | k2: 'v2'
|
@@ -231,7 +233,7 @@ describe('Test Webhook', () => {
|
231 | 233 | };
|
232 | 234 | self = sinon.spy(emitter, 'emit');
|
233 | 235 | getMethod.process.call(
|
234 |
| - { emit: self }, { |
| 236 | + { emit: self, logger }, { |
235 | 237 | body: {
|
236 | 238 | k1: 'v1',
|
237 | 239 | k2: 'v2'
|
@@ -276,7 +278,7 @@ describe('Test Webhook', () => {
|
276 | 278 | }
|
277 | 279 | };
|
278 | 280 | self = sinon.spy(emitter, 'emit');
|
279 |
| - receive.process.call({ emit: self }, msg, {}); |
| 281 | + receive.process.call({ emit: self, logger }, msg, {}); |
280 | 282 | }
|
281 | 283 | );
|
282 | 284 | executeAction.then(function resolve() {
|
@@ -314,7 +316,7 @@ describe('Test Webhook', () => {
|
314 | 316 | }
|
315 | 317 | };
|
316 | 318 | self = sinon.spy(emitter, 'emit');
|
317 |
| - receive.process.call({ emit: self }, msg, {}); |
| 319 | + receive.process.call({ emit: self, logger }, msg, {}); |
318 | 320 | }
|
319 | 321 | );
|
320 | 322 | executeAction.then(function resolve() {
|
|
0 commit comments