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)