From 1df22278c5d2e33a82ea353cdd890743bb7de604 Mon Sep 17 00:00:00 2001 From: Garanzha Dmitriy Date: Wed, 17 Jan 2018 19:49:13 +0200 Subject: [PATCH] @types/nock Multiple set cookie. (#22921) --- types/nock/index.d.ts | 3 ++- types/nock/nock-tests.ts | 6 ++++++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/types/nock/index.d.ts b/types/nock/index.d.ts index 8c6e4f2faf..91037b8e54 100644 --- a/types/nock/index.d.ts +++ b/types/nock/index.d.ts @@ -4,6 +4,7 @@ // Horiuchi_H // afharo // Matt R. Wilson +// Garanzha Dmitriy // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped /// @@ -34,7 +35,7 @@ declare namespace nock { export var back: NockBack; - type HttpHeaders = { [key: string]: string | { (req: any, res: any, body: string): any; }; }; + type HttpHeaders = { [key: string]: string | string[] | { (req: any, res: any, body: string): any; }; }; type InterceptFunction = ( uri: string | RegExp | { (uri: string): boolean; }, requestBody?: string | RegExp | { (body: any): boolean; } | any, diff --git a/types/nock/nock-tests.ts b/types/nock/nock-tests.ts index 180c7a9c63..e81e3fd096 100644 --- a/types/nock/nock-tests.ts +++ b/types/nock/nock-tests.ts @@ -368,6 +368,12 @@ var scope = nock('http://www.headdy.com') 'X-My-Headers': 'My Header value' }); +var scope = nock('http://www.headdy.com') + .get('/') + .reply(200, 'Hello World!', { + 'X-My-Headers': ['My Header value 1', 'My Header value 2'] + }); + var scope = nock('http://www.headdy.com') .get('/') .reply(200, 'Hello World!', {