-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathoutput-paths.test.ts
More file actions
41 lines (35 loc) · 1.3 KB
/
Copy pathoutput-paths.test.ts
File metadata and controls
41 lines (35 loc) · 1.3 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
import { resolve } from "node:path";
import { describe, expect, test } from "vitest";
import {
getDefaultExportFramesDir,
getDefaultExportPath,
getDefaultProjectPath,
} from "../src/cli/output-paths.js";
/** Absolute cwd fixture — avoid Windows-style roots on POSIX (they resolve relative to cwd). */
const fixtureCwd = resolve("/workspace");
describe("default output paths", () => {
test("project create defaults to output/output.piskel in cwd", () => {
expect(getDefaultProjectPath(fixtureCwd)).toBe(
resolve(fixtureCwd, "output", "output.piskel"),
);
});
test("export commands default to output/output.* in cwd", () => {
expect(getDefaultExportPath(fixtureCwd, "png")).toBe(
resolve(fixtureCwd, "output", "output.png"),
);
expect(getDefaultExportPath(fixtureCwd, "gif")).toBe(
resolve(fixtureCwd, "output", "output.gif"),
);
expect(getDefaultExportPath(fixtureCwd, "spritesheet")).toBe(
resolve(fixtureCwd, "output", "output.png"),
);
expect(getDefaultExportPath(fixtureCwd, "metadata")).toBe(
resolve(fixtureCwd, "output", "output.json"),
);
});
test("export frames defaults to output/frames in cwd", () => {
expect(getDefaultExportFramesDir(fixtureCwd)).toBe(
resolve(fixtureCwd, "output", "frames"),
);
});
});