From f7ff14b6fd580271a8e58ca5f7cc33d72929de30 Mon Sep 17 00:00:00 2001 From: Axetroy Date: Fri, 19 Apr 2019 23:25:44 +0800 Subject: [PATCH] fix ts warning for http/server_test.ts (#342) --- http/server_test.ts | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/http/server_test.ts b/http/server_test.ts index 09a8df2bd1..ed28025cde 100644 --- a/http/server_test.ts +++ b/http/server_test.ts @@ -19,14 +19,17 @@ interface ResponseTest { const enc = new TextEncoder(); const dec = new TextDecoder(); +type Handler = () => void; + interface Deferred { promise: Promise<{}>; - resolve: () => void; - reject: () => void; + resolve: Handler; + reject: Handler; } function deferred(isResolved = false): Deferred { - let resolve, reject; + let resolve: Handler = () => void 0; + let reject: Handler = () => void 0; const promise = new Promise((res, rej) => { resolve = res; reject = rej;