CombatSystem: 30 tests failing - .projectiles.add not a function #2
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Problem
npm testshows 30 failing tests, all in CombatSystem:Test stats: 30 failed, 120 passed, 150 total.
Root Cause
this.projectilesis a Phaser Group that should be created in the CombatSystem constructor. The test harness doesn't set up the Phaser Groups properly.Fix
In
src/systems/CombatSystem.js, ensurethis.projectilesis initialized as a Phaser Group (withthis.scene.physics.add.group()or similar). Then updatetests/unit/CombatSystem.test.jsto properly create the Group mock.Verification
npm testshould pass all 150 tests