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:
1 parent
b782064d54
commit
e62e92526c
1 file changed
+7
-4
@@ -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"]);
|
||||
});
|
||||
|
||||
|
||||
Reference in new issue
Block a user