Skip to content

fix: cross-platform default output path tests for CI#1

Merged
Ne9roni merged 1 commit into
masterfrom
cursor/fix-output-path-tests-cross-platform-2680
Apr 19, 2026
Merged

fix: cross-platform default output path tests for CI#1
Ne9roni merged 1 commit into
masterfrom
cursor/fix-output-path-tests-cross-platform-2680

Conversation

@Ne9roni
Copy link
Copy Markdown
Owner

@Ne9roni Ne9roni commented Apr 19, 2026

Summary

Recent CI failures (e.g. run 24354390623) all failed in tests/output-paths.test.ts on Ubuntu, not intermittently: the tests assumed Windows paths by passing C:/workspace and expecting backslash-separated results.

On Linux, path.resolve("C:/workspace", ...) treats C:/workspace as a relative path segment, so the result was cwd + "/C:/workspace/...", which does not match the intended absolute layout.

Changes

  • Use resolve("/workspace") as a portable absolute cwd fixture.
  • Assert against resolve(fixtureCwd, "output", ...) so expectations match getDefaultProjectPath / getDefaultExportPath / getDefaultExportFramesDir on every platform.

No production code changes; this aligns tests with Node's path semantics on POSIX vs Windows.

Open in Web Open in Cursor 

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>
@Ne9roni Ne9roni marked this pull request as ready for review April 19, 2026 13:48
@Ne9roni Ne9roni merged commit ec46a0c into master Apr 19, 2026
2 checks passed
@Ne9roni Ne9roni deleted the cursor/fix-output-path-tests-cross-platform-2680 branch April 19, 2026 13:48
Copy link
Copy Markdown

@cursor cursor Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Fix All in Cursor

❌ 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",
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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)
Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit 1978990. Configure here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants