- Added a FileSystemInitializationError.
- Changed the static init method to check basic schema (root format and existence) before returning. - Added getRoot method that throws generic Error if inode 0 doesnt resolve.
This commit is contained in:
@@ -86,8 +86,6 @@ describe("createNode", () => {
|
||||
expect(newFS).toBeInstanceOf(FileSystem);
|
||||
const newNode = newFS.getNode(5) as FileNode;
|
||||
|
||||
console.log(newNode);
|
||||
|
||||
expect(newNode.type).toBe(TreeNodeType.File);
|
||||
expect(newNode.name).toBe("readme");
|
||||
expect(new TextDecoder().decode(newNode.content.toArray())).toBe("Lorem ipsum");
|
||||
|
||||
@@ -49,7 +49,6 @@ describe("dnTraverseTree", () => {
|
||||
describe("upTraverseTree", () => {
|
||||
test("successfully traverses up the tree", () => {
|
||||
const result = upTraverseTree(fsTwo, 7);
|
||||
console.log(result);
|
||||
expect(result, `Checking the result ${result} to be [7, 6, 5, 4, 3, 2, 1, 0]`).toEqual([
|
||||
7, 6, 5, 4, 3, 2, 1, 0,
|
||||
]);
|
||||
|
||||
Reference in New Issue
Block a user