Skip to content

Commit

Permalink
test: add type test for Connection.withSession
Browse files Browse the repository at this point in the history
  • Loading branch information
tt-public committed Jun 25, 2024
1 parent 3ad5b4f commit 561a580
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions test/types/connection.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,11 @@ expectType<Promise<void>>(conn.transaction(async(res) => {
return 'a';
}, { readConcern: 'majority' }));

expectType<Promise<string>>(conn.withSession(async(res) => {
expectType<mongodb.ClientSession>(res);
return 'a';
}));

expectError(conn.user = 'invalid');
expectError(conn.pass = 'invalid');
expectError(conn.host = 'invalid');
Expand Down

0 comments on commit 561a580

Please sign in to comment.