fix(test): make qwen path assertion separator-agnostic for Windows CI

qwenChatJsonlPath uses path.join (OS-native), so on windows-latest the real path uses backslashes; the test hard-coded a forward-slash literal and failed. Build the expected with join() so it matches on every platform. macOS/Linux unaffected.
This commit is contained in:
Mert Koseoglu
2026-06-26 12:23:55 +03:00
parent 4a687d2b35
commit 589a0e95a0
+5 -1
View File
@@ -1,5 +1,6 @@
import { describe, it, expect } from "vitest";
import { createHash } from "node:crypto";
import { join } from "node:path";
import { parseQwenUsage, extractQwenUsageSince, qwenProjectHash, qwenChatJsonlPath } from "../../src/adapters/qwen-code/usage.js";
import { buildAgentUsageEvent } from "../../src/session/extract.js";
@@ -207,8 +208,11 @@ describe("qwenChatJsonlPath", () => {
const root = "/work/proj";
const sid = "sess-abc";
const hash = qwenProjectHash(root);
// Build the expected with join() so the assertion is separator-agnostic:
// qwenChatJsonlPath uses path.join (OS-native), so on win32 the real path
// uses backslashes — a hard-coded forward-slash literal fails there.
expect(qwenChatJsonlPath(home, root, sid)).toBe(
`/home/u/.qwen/tmp/${hash}/chats/${sid}.jsonl`,
join(home, "tmp", hash, "chats", `${sid}.jsonl`),
);
});
});