File tree Expand file tree Collapse file tree 1 file changed +7
-6
lines changed
Expand file tree Collapse file tree 1 file changed +7
-6
lines changed Original file line number Diff line number Diff line change 1+ import type { Server } from "node:http" ;
12import { describe , expect , it , vi } from "vitest" ;
23import { applyMSTeamsWebhookTimeouts } from "./webhook-timeouts.js" ;
34
45describe ( "applyMSTeamsWebhookTimeouts" , ( ) => {
56 it ( "applies default timeouts and header clamp" , ( ) => {
6- const httpServer = {
7+ const httpServer : Pick < Server , "setTimeout" | "requestTimeout" | "headersTimeout" > = {
78 setTimeout : vi . fn ( ) ,
89 requestTimeout : 0 ,
910 headersTimeout : 0 ,
10- } as never ;
11+ } ;
1112
12- applyMSTeamsWebhookTimeouts ( httpServer ) ;
13+ applyMSTeamsWebhookTimeouts ( httpServer as Server ) ;
1314
1415 expect ( httpServer . setTimeout ) . toHaveBeenCalledWith ( 30_000 ) ;
1516 expect ( httpServer . requestTimeout ) . toBe ( 30_000 ) ;
1617 expect ( httpServer . headersTimeout ) . toBe ( 15_000 ) ;
1718 } ) ;
1819
1920 it ( "uses explicit overrides and clamps headers timeout to request timeout" , ( ) => {
20- const httpServer = {
21+ const httpServer : Pick < Server , "setTimeout" | "requestTimeout" | "headersTimeout" > = {
2122 setTimeout : vi . fn ( ) ,
2223 requestTimeout : 0 ,
2324 headersTimeout : 0 ,
24- } as never ;
25+ } ;
2526
26- applyMSTeamsWebhookTimeouts ( httpServer , {
27+ applyMSTeamsWebhookTimeouts ( httpServer as Server , {
2728 inactivityTimeoutMs : 12_000 ,
2829 requestTimeoutMs : 9_000 ,
2930 headersTimeoutMs : 15_000 ,
You can’t perform that action at this time.
0 commit comments