From 16dd87cb3f93438a3a980ec8e936bfd1e5ba0801 Mon Sep 17 00:00:00 2001 From: Joni Salmi Date: Wed, 15 Nov 2017 13:49:17 +0200 Subject: [PATCH] Supertest@2.0.1: Add missing options argument for Agent --- types/supertest/index.d.ts | 5 ++++- types/supertest/supertest-tests.ts | 5 +++++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/types/supertest/index.d.ts b/types/supertest/index.d.ts index 6da2f54206..0716f9e1b5 100644 --- a/types/supertest/index.d.ts +++ b/types/supertest/index.d.ts @@ -32,7 +32,10 @@ declare namespace supertest { end(callback?: CallbackHandler): this; } - function agent(app?: any): SuperTest; + interface AgentOptions { + ca?: any; + } + function agent(app?: any, options?: AgentOptions): SuperTest; interface SuperTest extends superagent.SuperAgent { } diff --git a/types/supertest/supertest-tests.ts b/types/supertest/supertest-tests.ts index 7241aac5c3..868aa8fdce 100644 --- a/types/supertest/supertest-tests.ts +++ b/types/supertest/supertest-tests.ts @@ -42,6 +42,11 @@ client }); }); +// allow passing trusted CA as option to TestAgent +supertest.agent(app, { + ca: 'test ca', +}); + // functional expect (request .get('/') as supertest.Test)