test: add unit tests for getArchitecture and getAvx2 Windows ARM64 fallback logic#153
Merged
xhyrom merged 6 commits intofeat/win32-arm64-fallback-to-x64from Jan 5, 2026
Merged
Conversation
Co-authored-by: xhyrom <[email protected]>
Co-authored-by: xhyrom <[email protected]>
Copilot
AI
changed the title
[WIP] Update fallback arm64 to x64 architecture for win32 platform
Add unit tests for getArchitecture Windows ARM64 fallback logic
Jan 4, 2026
Contributor
There was a problem hiding this comment.
Pull request overview
This PR adds comprehensive unit test coverage for the getArchitecture function in src/utils.ts, specifically focusing on the Windows ARM64 to x64 fallback behavior. The tests verify that Windows ARM64 systems fall back to x64 with appropriate warnings, while other platforms handle ARM64 natively.
Key changes:
- Added 8 test cases covering Windows ARM64 fallback, non-Windows ARM64 handling, and architecture pass-through behavior
- Implemented proper spy management with cleanup to prevent test pollution
- Validated warning message content for Windows ARM64 scenarios
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-authored-by: Copilot <[email protected]>
xhyrom
approved these changes
Jan 5, 2026
Collaborator
|
@copilot resolve conflicts |
Co-authored-by: xhyrom <[email protected]>
Contributor
Author
Copilot
AI
changed the title
test: add unit tests for getArchitecture Windows ARM64 fallback logic
test: add unit tests for getArchitecture and getAvx2 Windows ARM64 fallback logic
Jan 5, 2026
xhyrom
added a commit
that referenced
this pull request
Jan 5, 2026
* feat: fallback arm64 to x64 architecture for win32 platform closes #130 * [autofix.ci] apply automated fixes * ci: test on windows-11-arm runner * refactor: move logic to getEffectiveArch func * [autofix.ci] apply automated fixes * feat: add warning message for windows arm64 fallback to x64 * [autofix.ci] apply automated fixes * feat: don't mention arch in warning msg aboout fallback * [autofix.ci] apply automated fixes * debug time * [autofix.ci] apply automated fixes * feat: force baseline for win32 arm fallback to x64 * [autofix.ci] apply automated fixes * ci: dont use windows-11-arm on setup bun from download url * fix * [autofix.ci] apply automated fixes * fix * [autofix.ci] apply automated fixes * fix * [autofix.ci] apply automated fixes * fix * [autofix.ci] apply automated fixes * fix * [autofix.ci] apply automated fixes * apply changes Co-authored-by: Copilot <[email protected]> * [autofix.ci] apply automated fixes * docs: clarify * [autofix.ci] apply automated fixes * test: add unit tests for getAvx2 Windows ARM64 fallback logic (#154) * Initial plan * Add unit tests for getAvx2 function Co-authored-by: xhyrom <[email protected]> * Consolidate duplicate test assertions in getAvx2 tests Co-authored-by: xhyrom <[email protected]> * Fix whitespace formatting in test file Co-authored-by: xhyrom <[email protected]> --------- Co-authored-by: copilot-swe-agent[bot] <[email protected]> Co-authored-by: xhyrom <[email protected]> * test: add unit tests for getArchitecture and getAvx2 Windows ARM64 fallback logic (#153) * Initial plan * Add unit tests for getArchitecture function Co-authored-by: xhyrom <[email protected]> * Remove unused import in utils.spec.ts Co-authored-by: xhyrom <[email protected]> * Apply suggestion from @Copilot Co-authored-by: Copilot <[email protected]> * Merge pr-131 and resolve test file conflicts Co-authored-by: xhyrom <[email protected]> --------- Co-authored-by: copilot-swe-agent[bot] <[email protected]> Co-authored-by: xhyrom <[email protected]> Co-authored-by: Jozef Steinhübl <[email protected]> Co-authored-by: Copilot <[email protected]> --------- Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com> Co-authored-by: Copilot <[email protected]> Co-authored-by: Copilot <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Addresses review feedback requesting test coverage for the
getArchitecturefunction's Windows ARM64→x64 fallback behavior. Also includes tests for thegetAvx2function merged from the base branch.Changes
tests/utils.spec.tswith 14 test cases covering:arm64/aarch64→ returnsx64+ emits warningarm64→ returnsaarch64(no warning)x64,x86) → pass-through unchangedfalseavx2parameter or defaults totrueavx2parameter or defaults totrueTest Coverage
All tests use proper spy cleanup to avoid cross-test pollution.
💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.