Skip to content

Commit 08a76b2

Browse files
Update postgresql snapshot tests
1 parent 20cdb6d commit 08a76b2

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

packages/modules/postgresql/src/postgresql-container-snapshot.test.ts

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,12 @@
11
import { Client } from "pg";
22
import { PostgreSqlContainer } from "./postgresql-container";
33

4+
const IMAGE = "postgres:13.3-alpine";
5+
46
describe("PostgreSqlContainer snapshot and restore", { timeout: 180_000 }, () => {
57
// createAndRestoreFromSnapshot {
68
it("should create and restore from snapshot", async () => {
7-
const container = await new PostgreSqlContainer().start();
9+
const container = await new PostgreSqlContainer(IMAGE).start();
810

911
// Connect to the database
1012
let client = new Client({
@@ -60,7 +62,7 @@ describe("PostgreSqlContainer snapshot and restore", { timeout: 180_000 }, () =>
6062
// }
6163

6264
it("should use custom snapshot name", async () => {
63-
const container = await new PostgreSqlContainer().start();
65+
const container = await new PostgreSqlContainer(IMAGE).start();
6466
const customSnapshotName = "my_custom_snapshot";
6567

6668
// Connect to the database
@@ -110,7 +112,7 @@ describe("PostgreSqlContainer snapshot and restore", { timeout: 180_000 }, () =>
110112
});
111113

112114
it("should handle multiple snapshots", async () => {
113-
const container = await new PostgreSqlContainer().start();
115+
const container = await new PostgreSqlContainer(IMAGE).start();
114116

115117
// Connect to the database
116118
let client = new Client({
@@ -193,7 +195,7 @@ describe("PostgreSqlContainer snapshot and restore", { timeout: 180_000 }, () =>
193195
});
194196

195197
it("should throw an error when trying to snapshot postgres system database", async () => {
196-
const container = await new PostgreSqlContainer().withDatabase("postgres").start();
198+
const container = await new PostgreSqlContainer(IMAGE).withDatabase("postgres").start();
197199

198200
await expect(container.snapshot()).rejects.toThrow(
199201
"Snapshot feature is not supported when using the postgres system database"

0 commit comments

Comments
 (0)