Skip to content

Commit

Permalink
req-closed test passing as ts
Browse files Browse the repository at this point in the history
  • Loading branch information
nfriedly committed Sep 20, 2023
1 parent d73fba7 commit 393c2c5
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions test/req-closed.test.js → test/req-closed.test.ts
Original file line number Diff line number Diff line change
@@ -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', () => {
Expand All @@ -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
Expand Down

0 comments on commit 393c2c5

Please sign in to comment.