Skip to content

fix: make test paths portable across different environments#45

Closed
zylar06 wants to merge 2 commits intoopenai:mainfrom
zylar06:zylar06/fix-tests
Closed

fix: make test paths portable across different environments#45
zylar06 wants to merge 2 commits intoopenai:mainfrom
zylar06:zylar06/fix-tests

Conversation

@zylar06
Copy link
Copy Markdown

@zylar06 zylar06 commented Mar 31, 2026

Summary

Fixed hardcoded absolute paths in test files that were specific to the original developer's local environment.

Changes

  • tests/commands.test.mjs: Replaced hardcoded path /Users/dkundel/code/codex-plugin with a dynamic path resolution using fileURLToPath(import.meta.url)
  • tests/runtime.test.mjs: Replaced the same hardcoded path with dynamic resolution

Why

The original test files contained absolute paths pointing to a specific developer's machine (/Users/dkundel/code/codex-plugin). This caused tests to fail when run on any other machine or environment.

How

Used fileURLToPath(import.meta.url) combined with path.resolve() and path.dirname() to compute the project root path dynamically relative to the test file's location, making the tests portable across all environments.

@zylar06 zylar06 requested a review from a team March 31, 2026 06:06
@dkundel-openai
Copy link
Copy Markdown
Collaborator

Thank you for the contribution! Closing in favor of #45

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