Add unit tests to fix CI "No tests found" failure#9
Draft
Copilot wants to merge 4 commits intocopilot/review-ci-run-detailsfrom
Draft
Add unit tests to fix CI "No tests found" failure#9Copilot wants to merge 4 commits intocopilot/review-ci-run-detailsfrom
Copilot wants to merge 4 commits intocopilot/review-ci-run-detailsfrom
Conversation
Co-authored-by: astickleyid <201894828+astickleyid@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Refactor image upload process for improved reliability
Add unit tests to fix CI "No tests found" failure
Feb 28, 2026
There was a problem hiding this comment.
Pull request overview
Adds Jest unit tests under src/__tests__ to ensure CI no longer fails with “No tests found” and to provide baseline coverage for core game logic modules (constants, Zustand stores, and A* pathfinding).
Changes:
- Added unit tests validating exported config constants (palette, camera, performance, materials, physics, resources).
- Added unit tests for
useGameStoreanduseResourceStorestate transitions and reset behavior. - Added unit tests for
AStarPathfinderpath generation, obstacle avoidance, and edge cases.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
| src/tests/constants.test.ts | Verifies key exported values from src/config/constants.ts to prevent accidental config drift. |
| src/tests/gameStore.test.ts | Exercises useGameStore initial state and action-driven transitions (RTS/FPS, pause, reset). |
| src/tests/resourceStore.test.ts | Exercises useResourceStore initial state, add/consume operations, power accounting setters, and reset. |
| src/tests/pathfinding.test.ts | Validates AStarPathfinder pathfinding behavior across clear routes, obstacles, unreachable goals, and invariants (y=0). |
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
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.
📝 Description
CI was failing with
No tests found, exiting with code 1— Jest found zero matching test files. Adds 42 unit tests across 4 suites covering the core game logic modules.🎮 Type of Change
🎯 Game Mode Impact
🔍 What Changed?
Added
src/__tests__/constants.test.ts— validates all exported constants (colors, camera FOV/distances, performance budgets, material properties, physics values, resource names)src/__tests__/gameStore.test.ts— covers alluseGameStoreactions:selectUnit,enterFPS,exitFPS,togglePause,reset; asserts initial state and state transitionssrc/__tests__/resourceStore.test.ts— coversaddCredits/Fuel/Power,consumeCredits/Fuel(sufficient and insufficient cases),setPowerConsumption/Production,resetsrc/__tests__/pathfinding.test.ts— coversAStarPathfinder: direct paths, diagonal routing, obstacle avoidance, unreachable goals, same-node paths, y=0 constraint on all nodesChanged
Fixed
Removed
📸 Screenshots/Videos
N/A
🧪 Testing
How Has This Been Tested?
Test Configuration
npm test -- --coverage --maxWorkers=2— 4 suites, 42 tests, all pass✅ Checklist
🎯 Performance Impact
📋 Related Issues
Relates to https://github.com/astickleyid/iron-command-ios/actions/runs/21166989269/job/61015583962
📝 Additional Notes
Tests run against existing source without mocks —
useGameStoreanduseResourceStoreare exercised viagetState()directly (no React renderer needed);AStarPathfinderis instantiated with a small 20×20 grid to keep tests fast.🎖️ Deployment Notes
No deployment impact.
By submitting this PR, I confirm that:
Original prompt
💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.