Skip to content

Commit

Permalink
Add newTestUserAgent example
Browse files Browse the repository at this point in the history
  • Loading branch information
kraih committed Mar 18, 2023
1 parent a064777 commit cc51cf4
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/app.ts
Original file line number Diff line number Diff line change
Expand Up @@ -353,6 +353,10 @@ export class App {

/**
* Create a new test user-agent for application.
* @example
* // Test plain text endpoint
* const ua = await app.newTestUserAgent();
* (await ua.getOk('/')).statusIs(200).bodyIs('Hello World!');
*/
async newTestUserAgent(options?: TestUserAgentOptions, serverOptions?: ServerOptions): Promise<TestUserAgent> {
return await TestUserAgent.newTestUserAgent(this, options, serverOptions);
Expand Down

0 comments on commit cc51cf4

Please sign in to comment.