test(reference-source): avoid filesystem enumeration order assumptions

Assert exact inventory contents and cardinality without depending on directory enumeration order.

Validation: all nine reader boundary tests pass.

Based on #3117.

Co-authored-by: Yog D <yogd7657@gmail.com>
This commit is contained in:
morluto
2026-10-14 13:58:18 +08:00
parent b782064d54
commit e62e92526c
@@ -176,10 +176,13 @@ describe("readReferenceSource failures and exclusions", () => {
});
if (!result.ok) throw result.error;
expect(checked).toEqual([
["ignored", "directory"],
["kept", "file"],
]);
expect(checked).toHaveLength(2);
expect(checked).toEqual(
expect.arrayContaining([
["ignored", "directory"],
["kept", "file"],
]),
);
expect(result.value.entries.map(({ path }) => path)).toEqual(["kept"]);
});