Skip to content

Commit 4569570

Browse files
authored
Enhance paths.test.ts with path import and tests
Added path import to test file and updated test for model file resolution.
1 parent a47cd58 commit 4569570

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

test/paths.test.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import { describe, expect, test, beforeEach, afterEach } from "bun:test";
22
import { resolveModelFile, resolveReferenceAudioPath } from "../src/paths";
33
import { isAbsolute } from "path";
4+
import path from "path";
45

56
describe("resolveModelFile", () => {
67
const saved: Record<string, string | undefined> = {};
@@ -26,6 +27,12 @@ describe("resolveModelFile", () => {
2627
expect(resolveModelFile("model.gguf")).toBe("model.gguf");
2728
});
2829

30+
test("joins models dir for bare filename", () => {
31+
process.env.ACESTEP_MODELS_DIR = "/data/models";
32+
const expected = path.join("/data/models", "dit.gguf");
33+
expect(path.normalize(resolveModelFile("dit.gguf"))).toBe(path.normalize(expected));
34+
});
35+
2936
test("joins models dir for bare filename", () => {
3037
process.env.ACESTEP_MODELS_DIR = "/data/models";
3138
expect(resolveModelFile("dit.gguf")).toBe("/data/models/dit.gguf");

0 commit comments

Comments
 (0)