@@ -5,11 +5,10 @@ import * as mod from '../src/slack'
55import { EventEmitter } from 'events'
66
77describe ( 'slack integration' , ( ) => {
8- let consoleSpy : jest . SpyInstance
98 let consoleErrorSpy : jest . SpyInstance
109
1110 beforeEach ( ( ) => {
12- consoleSpy = jest . spyOn ( global . console , 'log' ) . mockImplementation ( )
11+ jest . spyOn ( global . console , 'log' ) . mockImplementation ( )
1312 consoleErrorSpy = jest . spyOn ( global . console , 'error' ) . mockImplementation ( )
1413 } )
1514
@@ -26,9 +25,11 @@ describe('slack integration', () => {
2625
2726 it ( 'sends notification when webhook URL is configured' , async ( ) => {
2827 jest . spyOn ( config , 'slackWebhookUrl' , 'get' ) . mockReturnValue ( 'https://hooks.slack.com/services/test' )
28+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
2929 const mockReq = new EventEmitter ( ) as any
3030 mockReq . write = jest . fn ( )
3131 mockReq . end = jest . fn ( )
32+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
3233 const mockRes = new EventEmitter ( ) as any
3334 mockRes . statusCode = 200
3435 ; ( https . request as jest . Mock ) . mockImplementation ( ( options , callback ) => {
@@ -41,9 +42,11 @@ describe('slack integration', () => {
4142
4243 it ( 'returns false when request fails with non-200' , async ( ) => {
4344 jest . spyOn ( config , 'slackWebhookUrl' , 'get' ) . mockReturnValue ( 'https://hooks.slack.com/services/test' )
45+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
4446 const mockReq = new EventEmitter ( ) as any
4547 mockReq . write = jest . fn ( )
4648 mockReq . end = jest . fn ( )
49+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
4750 const mockRes = new EventEmitter ( ) as any
4851 mockRes . statusCode = 500
4952 ; ( https . request as jest . Mock ) . mockImplementation ( ( options , callback ) => {
@@ -57,6 +60,7 @@ describe('slack integration', () => {
5760
5861 it ( 'returns false when request errors' , async ( ) => {
5962 jest . spyOn ( config , 'slackWebhookUrl' , 'get' ) . mockReturnValue ( 'https://hooks.slack.com/services/test' )
63+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
6064 const mockReq = new EventEmitter ( ) as any
6165 mockReq . write = jest . fn ( )
6266 mockReq . end = jest . fn ( )
@@ -98,14 +102,17 @@ describe('slack integration', () => {
98102 } )
99103
100104 describe ( 'notifySlack' , ( ) => {
105+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
101106 let mockReq : any
102107
103108 beforeEach ( ( ) => {
104109 jest . spyOn ( config , 'slackWebhookUrl' , 'get' ) . mockReturnValue ( 'https://hooks.slack.com/services/test' )
105110 jest . spyOn ( config , 'githubOrg' , 'get' ) . mockReturnValue ( 'myorg' )
111+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
106112 mockReq = new EventEmitter ( ) as any
107113 mockReq . write = jest . fn ( )
108114 mockReq . end = jest . fn ( )
115+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
109116 const mockRes = new EventEmitter ( ) as any
110117 mockRes . statusCode = 200
111118 ; ( https . request as jest . Mock ) . mockImplementation ( ( options , callback ) => {
0 commit comments