Skip to content

Commit 3d5f6cc

Browse files
Nik SamokhvalovNik Samokhvalov
authored andcommitted
test(cli): fix Postgres socket port in integration tests
- Pass the chosen port for unix-socket connections (pg defaults to 5432 otherwise)
1 parent 0652adc commit 3d5f6cc

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

cli/test/init.integration.test.cjs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,8 @@ async function withTempPostgres(t) {
9595
const { Client } = require("pg");
9696

9797
const connectLocal = async (database = "postgres") => {
98-
const c = new Client({ host: socketDir, user: "postgres", database });
98+
// IMPORTANT: must match the port Postgres is started with; otherwise pg defaults to 5432 and the socket path won't exist.
99+
const c = new Client({ host: socketDir, port, user: "postgres", database });
99100
await c.connect();
100101
return c;
101102
};

0 commit comments

Comments
 (0)