Merge pull request #21531 from josalmi/supertest-agent-options

Supertest@2.0.1: Add  missing options argument for Agent
This commit is contained in:
Benjamin Lichtman
2017-11-21 13:13:19 -08:00
committed by GitHub
2 changed files with 9 additions and 1 deletions
+4 -1
View File
@@ -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> {
}
+5
View File
@@ -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)