Skip to content

Commit 5b38229

Browse files
committed
test: update assertions in loaders tests for better validation
1 parent 6a857db commit 5b38229

1 file changed

Lines changed: 9 additions & 5 deletions

File tree

packages/core/tests/loaders.test.ts

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
import { expect, test } from "bun:test";
21
import { BunContext } from "@effect/platform-bun";
2+
import { expect, test } from "bun:test";
33
import { ConfigProvider, Effect, Schema } from "effect";
44
import * as loaders from "../src/loaders";
55

@@ -31,7 +31,8 @@ test("loads JSON collection from files", async () => {
3131
program.pipe(Effect.provide(BunContext.layer)),
3232
);
3333

34-
expect(res).toEqual(expectedData);
34+
expect(res).toEqual(expect.arrayContaining(expectedData));
35+
expect(res).toHaveLength(expectedData.length);
3536
});
3637

3738
test("loads JSON collection from lines file", async () => {
@@ -46,7 +47,8 @@ test("loads JSON collection from lines file", async () => {
4647
program.pipe(Effect.provide(BunContext.layer)),
4748
);
4849

49-
expect(res).toEqual(expectedData);
50+
expect(res).toEqual(expect.arrayContaining(expectedData));
51+
expect(res).toHaveLength(expectedData.length);
5052
});
5153

5254
test("loads YAML collection from files", async () => {
@@ -61,7 +63,8 @@ test("loads YAML collection from files", async () => {
6163
program.pipe(Effect.provide(BunContext.layer)),
6264
);
6365

64-
expect(res).toEqual(expectedData);
66+
expect(res).toEqual(expect.arrayContaining(expectedData));
67+
expect(res).toHaveLength(expectedData.length);
6568
});
6669

6770
test("loads YAML collection from stream file", async () => {
@@ -76,5 +79,6 @@ test("loads YAML collection from stream file", async () => {
7679
program.pipe(Effect.provide(BunContext.layer)),
7780
);
7881

79-
expect(res).toEqual(expectedData);
82+
expect(res).toEqual(expect.arrayContaining(expectedData));
83+
expect(res).toHaveLength(expectedData.length);
8084
});

0 commit comments

Comments
 (0)