Skip to content

Commit 8570b79

Browse files
refactor: update connection options assertions in NatsContainer tests
1 parent 109fc79 commit 8570b79

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

packages/modules/nats/src/nats-container.test.ts

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,11 @@ describe("NatsContainer", { timeout: 180_000 }, () => {
99
// connect {
1010
it("should start, connect and close", async () => {
1111
const container = await new NatsContainer(IMAGE).start();
12-
12+
expect(container.getConnectionOptions().pass).toEqual("test");
13+
expect(container.getConnectionOptions().user).toEqual("test");
1314
// establish connection
1415
const nc = await connect(container.getConnectionOptions());
15-
// close the connection
16+
1617
await nc.close();
1718
// check if the close was OK
1819
const err = await nc.closed();
@@ -23,7 +24,8 @@ describe("NatsContainer", { timeout: 180_000 }, () => {
2324
// noCredentials {
2425
it("should start, connect and close when noCredentials is true", async () => {
2526
const container = await new NatsContainer(IMAGE).withCredentials(false).start();
26-
27+
expect(container.getConnectionOptions().user).toBeUndefined();
28+
expect(container.getConnectionOptions().pass).toBeUndefined();
2729
// establish connection
2830
const nc = await connect(container.getConnectionOptions());
2931
// close the connection

0 commit comments

Comments
 (0)