Skip to content

Commit 0c197d7

Browse files
feggeclaude
andcommitted
fix: use path.join for cross-platform test compatibility
The extension uses path.relative() which returns OS-native separators. On Windows this produces backslashes (src\sample.ts) while the tests were hardcoding forward slashes (src/sample.ts), causing path comparison failures in CI. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <[email protected]>
1 parent f8a2058 commit 0c197d7

File tree

2 files changed

+6
-3
lines changed

2 files changed

+6
-3
lines changed

test/extension/suite/commands.test.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -213,7 +213,8 @@ suite("Command Execution", () => {
213213

214214
// First, mark a file as audited to ensure there's content in the day log
215215
await openTestFile();
216-
const relativePath = "src/sample.ts";
216+
// Use path.join for cross-platform compatibility (Windows uses backslashes)
217+
const relativePath = path.join("src", "sample.ts");
217218

218219
// Check if file is already audited
219220
const dataBefore = readWeauditData(workspaceFolder);

test/extension/suite/decorations.test.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,8 @@ suite("Editor Decorations", () => {
8787
this.timeout(10000);
8888

8989
await openTestFile();
90-
const relativePath = "src/sample.ts";
90+
// Use path.join for cross-platform compatibility (Windows uses backslashes)
91+
const relativePath = path.join("src", "sample.ts");
9192

9293
// Get the initial state
9394
const dataBefore = readWeauditData(workspaceFolder);
@@ -110,7 +111,8 @@ suite("Editor Decorations", () => {
110111
this.timeout(10000);
111112

112113
const editor = await openTestFile();
113-
const relativePath = "src/sample.ts";
114+
// Use path.join for cross-platform compatibility (Windows uses backslashes)
115+
const relativePath = path.join("src", "sample.ts");
114116

115117
// Ensure the file is not fully audited (which would prevent partial auditing)
116118
// The previous test may have marked it as fully audited

0 commit comments

Comments
 (0)