Skip to content

test(doctor): use native temp paths in Copilot fixtures - #1491

Merged
SaulMoro merged 1 commit into
Tencent:mainfrom
huong8373tt-beep:fix/copilot-doctor-detection
Oct 28, 2026
Merged

SaulMoro merged 1 commit into
Tencent:mainfrom
huong8373tt-beep:fix/copilot-doctor-detection

Conversation

@huong8373tt-beep

Copy link
Copy Markdown
Contributor

Summary

Fix the two existing Windows failures in doctor.test.ts caused by Copilot fixtures hard-coding POSIX /tmp/... paths.

The tests are path-sensitive: on Windows, the production path resolver normalizes COPILOT_HOME to a native path while the mock setup still compares it with the POSIX fixture path. This made the tests report:

  • standalone Copilot hooks under COPILOT_HOME as missing;
  • a project Copilot installation check as present when only .github/hooks was configured.

This change uses os.tmpdir() and path.join() for the affected fixtures. It is test-only and does not change Copilot runtime behavior.

Validation

  • npx vitest run src/__tests__/doctor.test.ts: 69 passed
  • npm run lint: passed
  • npm run typecheck: passed
  • npm run build: passed
  • git diff --check: passed

Refs #1474

@github-actions

Copy link
Copy Markdown

No findings in the specified diff.

The changes are test-only: they replace hard-coded POSIX fixture paths with path.join(os.tmpdir(), ...). The PR description documents sufficient validation; no end-to-end / real-CLI record is required for a tests-only change.

Review was read-only; I did not run, build, or install anything.

@SaulMoro SaulMoro left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

This was generated by AI during triage.

Approving at 276081b. The two Copilot fixtures now build their paths with path.join(os.tmpdir(), …), so on Windows they match the native path the resolver returns for COPILOT_HOME. It is test-only and changes no runtime behaviour, and CI passes on every OS at this head. On a merge with main after #1474, which also changes doctor.test.ts, the file passes 72/72.

@SaulMoro
SaulMoro merged commit 4d3d1f1 into Tencent:main Oct 28, 2026
18 checks passed
Walternater pushed a commit to Walternater/teamai-cli that referenced this pull request Nov 2, 2026
The Copilot doctor fixtures build their paths with path.join(os.tmpdir(), ...), so on Windows they match the native path the resolver returns for COPILOT_HOME.
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.

3 participants