From 2eb6ca7acf205d87f212a874e1316050e8cf79b2 Mon Sep 17 00:00:00 2001 From: Joost Farla Date: Wed, 7 Sep 2016 12:52:49 +0200 Subject: [PATCH] nock: Added missing delay functions (#11029) --- nock/nock-tests.ts | 6 ++++++ nock/nock.d.ts | 3 +++ 2 files changed, 9 insertions(+) diff --git a/nock/nock-tests.ts b/nock/nock-tests.ts index bc936a05b8..ffb456b420 100644 --- a/nock/nock-tests.ts +++ b/nock/nock-tests.ts @@ -97,6 +97,12 @@ inst = inst.log(() => { }); +inst = inst.delay(2000); +inst = inst.delayBody(2000); +inst = inst.delayConnection(2000); +inst.getTotalDelay(); +inst = inst.socketDelay(2000); + inst.done(); bool = inst.isDone(); inst.restore(); diff --git a/nock/nock.d.ts b/nock/nock.d.ts index b82721da78..615ec0d3ca 100644 --- a/nock/nock.d.ts +++ b/nock/nock.d.ts @@ -96,7 +96,10 @@ declare module "nock" { log(out: () => void): Scope; delay(timeMs: number): Scope; + delayBody(timeMs: number): Scope; delayConnection(timeMs: number): Scope; + getTotalDelay(): number; + socketDelay(timeMs: number): Scope; times(repeats: number): Scope; once(): Scope;