From 481a83ca7cd82a13f4d2f366f0a60b73d06e264a Mon Sep 17 00:00:00 2001 From: Admin Date: Fri, 18 Sep 2026 00:58:16 +0000 Subject: [PATCH] Test safe player hit FX wiring --- tests/wiring.test.mjs | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/tests/wiring.test.mjs b/tests/wiring.test.mjs index 5d76604..f954f25 100644 --- a/tests/wiring.test.mjs +++ b/tests/wiring.test.mjs @@ -90,3 +90,12 @@ test('a hit frame emits a completion marker after the rest of scene update runs' assert.match(source, /const hadQueuedPlayerHit = this\.pendingPlayerHits\.length > 0/); assert.match(source, /this\.checkGameState\(\);[\s\S]*?combat:post-hit-frame-complete/); }); + +test('player hit FX runs after queued hit processing, outside the overlap callback', async () => { + const source = await read('src/game-v4.js'); + + assert.match(source, /this\.pendingPlayerHits\.push\(\{[\s\S]*?x: shot\.x,[\s\S]*?y: shot\.y/); + assert.match(source, /if \(result\.appliedHits > 0\) \{[\s\S]*?this\.spawnExplosion\(impact\.x, impact\.y, 0\.32\)/); + assert.match(source, /this\.flashShip\(this\.player, 0xffcccc\)/); + assert.match(source, /combat:player-hit-fx-error/); +});