From 393c2c5148f113435a3e74d111b1af332af7484f Mon Sep 17 00:00:00 2001 From: Nathan Friedly Date: Tue, 19 Sep 2023 23:52:58 -0400 Subject: [PATCH] req-closed test passing as ts --- test/{req-closed.test.js => req-closed.test.ts} | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) rename test/{req-closed.test.js => req-closed.test.ts} (86%) diff --git a/test/req-closed.test.js b/test/req-closed.test.ts similarity index 86% rename from test/req-closed.test.js rename to test/req-closed.test.ts index e7188c9..762f998 100644 --- a/test/req-closed.test.js +++ b/test/req-closed.test.ts @@ -1,4 +1,12 @@ import EventEmitter from 'node:events' +import { + describe, + expect, + beforeEach, + afterEach, + jest, + it, +} from '@jest/globals' import slowDown from '../source/express-slow-down' describe('Connection closed during delay tests', () => { @@ -12,8 +20,8 @@ describe('Connection closed during delay tests', () => { }) it('should not excute slow down timer in case of req closed', async () => { - const request = new EventEmitter() - const res = new EventEmitter() + const request = new EventEmitter() as any + const res = new EventEmitter() as any // Gotta do a bunch of sillyness to convinve it the request isn't finished at the start request.socket = new EventEmitter() request.socket.readable = true