- Old tests fixed
- Added a static Fixuture class for test mockups
This commit is contained in:
@@ -1,10 +1,10 @@
|
||||
import { resolveInode, resolvePath } from "@core/util/path_resolver";
|
||||
import { expectNodeNotFoundError, expectNotADirectoryError } from "@tests/helpers/error_matchers";
|
||||
import { buildTestFS } from "@tests/helpers/filesystems_fixture";
|
||||
import { depth7Tree } from "@tests/helpers/tree_fixture";
|
||||
import { Fixture7Depth } from "@tests/helpers/state_fixture";
|
||||
import { describe, expect, test } from "vitest";
|
||||
|
||||
const fs = buildTestFS(depth7Tree);
|
||||
const state = Fixture7Depth.State;
|
||||
const fs = state.filesystem;
|
||||
|
||||
describe("resolvePath", () => {
|
||||
test("returns an inode from an absolute path", () => {
|
||||
@@ -64,10 +64,10 @@ describe("resolvePath", () => {
|
||||
|
||||
describe("resolveInode", () => {
|
||||
test("returns an the path from the d4 node", () => {
|
||||
expect(resolveInode(fs, 4)).toBe("/d1/d2/d3/d4");
|
||||
expect(resolveInode(state, 4, true)).toBe("/d1/d2/d3/d4");
|
||||
});
|
||||
|
||||
test("returns an empty string from a non existent inode", () => {
|
||||
expect(resolveInode(fs, 999)).toBe("");
|
||||
expect(resolveInode(state, 999)).toBe("");
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user