fix: cross-platform default output path tests for CI#1
Conversation
CI on Linux failed because tests passed a Windows-style root (C:/...) which path.resolve treats as a relative segment on POSIX. Use an absolute /workspace fixture and compare against resolve() so behavior matches getDefault* helpers on all platforms. Co-authored-by: Ne9roni <Ne9roni@users.noreply.github.com>
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit 1978990. Configure here.
|
|
||
| test("export commands default to output/output.* in cwd", () => { | ||
| expect(getDefaultExportPath("C:/workspace", "png")).toBe( | ||
| "C:\\workspace\\output\\output.png", |
There was a problem hiding this comment.
Tests are tautological — expected values mirror production logic
Low Severity
Every assertion now computes its expected value with resolve(fixtureCwd, "output", …), which is identical to the implementation in getDefaultProjectPath / getDefaultExportPath / getDefaultExportFramesDir. The tests effectively assert resolve(x, "output", "output.piskel") === resolve(x, "output", "output.piskel"), meaning a regression in the production code's path structure (e.g., changing the resolve call to join, or altering separator behavior) would never be caught. Using a platform-aware but independently constructed expected string (e.g. fixtureCwd + "/output/output.piskel" on POSIX) would keep the cross-platform fix while preserving the test's ability to detect real bugs.
Additional Locations (2)
Reviewed by Cursor Bugbot for commit 1978990. Configure here.


Summary
Recent CI failures (e.g. run 24354390623) all failed in
tests/output-paths.test.tson Ubuntu, not intermittently: the tests assumed Windows paths by passingC:/workspaceand expecting backslash-separated results.On Linux,
path.resolve("C:/workspace", ...)treatsC:/workspaceas a relative path segment, so the result wascwd + "/C:/workspace/...", which does not match the intended absolute layout.Changes
resolve("/workspace")as a portable absolute cwd fixture.resolve(fixtureCwd, "output", ...)so expectations matchgetDefaultProjectPath/getDefaultExportPath/getDefaultExportFramesDiron every platform.No production code changes; this aligns tests with Node's
pathsemantics on POSIX vs Windows.