MCPcopy Create free account
hub / github.com/denodrivers/postgres / generateSimpleClientTest

Function generateSimpleClientTest

tests/helpers.ts:5–21  ·  view source on GitHub ↗
(
  client_options: ClientOptions,
)

Source from the content-addressed store, hash-verified

3import type { ClientOptions } from "../connection/connection_params.ts";
4
5export function generateSimpleClientTest(
6 client_options: ClientOptions,
7) {
8 return function testSimpleClient(
9 test_function: (client: Client) => Promise<void>,
10 ): () => Promise<void> {
11 return async () => {
12 const client = new Client(client_options);
13 try {
14 await client.connect();
15 await test_function(client);
16 } finally {
17 await client.end();
18 }
19 };
20 };
21}
22
23export function generatePoolClientTest(client_options: ClientOptions) {
24 return function generatePoolClientTest1(

Callers 1

data_types_test.tsFile · 0.90

Calls 2

connectMethod · 0.80
endMethod · 0.45

Tested by

no test coverage detected