- Old tests fixed

- Added a static Fixuture class for test mockups
This commit is contained in:
2026-08-28 16:52:59 +02:00
parent 310218663d
commit 1ee2a2fe7a
13 changed files with 161 additions and 306 deletions
+4 -1
View File
@@ -38,7 +38,10 @@ const fsTwo = buildTestFS(depth7Tree);
describe("dnTraverseTree", () => {
test("successfully traverses down the tree in depth-first pre-order", () => {
const result = dnTraverseTree(fs, 0);
expect(result, `Checking the result ${result} to be [0, 1, 2, 3]`).toEqual([0, 2, 3, 1]);
// This got changed from [0, 2, 3, 1] to [1, 2, 3]
// A bug in dnTraverseTree resulted in the tree traversal not respecting order of nodes, and including root.
// Including root in results caused further problems so it was decided that results wont include the passed root node;
expect(result, `Checking the result ${result} to be [1, 2, 3]`).toEqual([1, 2, 3]);
});
test("returns empty array for a non existent root inode", () => {