1
0
Fork 0
mirror of https://github.com/denoland/deno.git synced 2024-12-27 01:29:14 -05:00

fix ts warning for http/server_test.ts (#342)

This commit is contained in:
Axetroy 2019-04-19 23:25:44 +08:00 committed by Ryan Dahl
parent 191e53a78b
commit f7ff14b6fd

View file

@ -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;