mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-10-05 15:27:05 +00:00
Merge pull request #21531 from josalmi/supertest-agent-options
Supertest@2.0.1: Add missing options argument for Agent
This commit is contained in:
Vendored
+4
-1
@@ -32,7 +32,10 @@ declare namespace supertest {
|
||||
end(callback?: CallbackHandler): this;
|
||||
}
|
||||
|
||||
function agent(app?: any): SuperTest<Test>;
|
||||
interface AgentOptions {
|
||||
ca?: any;
|
||||
}
|
||||
function agent(app?: any, options?: AgentOptions): SuperTest<Test>;
|
||||
|
||||
interface SuperTest<T extends superagent.SuperAgentRequest> extends superagent.SuperAgent<T> {
|
||||
}
|
||||
|
||||
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user