diff --git a/tests/wiring.test.mjs b/tests/wiring.test.mjs index a2e2fcf..9088727 100644 --- a/tests/wiring.test.mjs +++ b/tests/wiring.test.mjs @@ -220,8 +220,9 @@ test('processed player hits drive sprite and HUD hit reactions', async () => { test('processed pirate shots are consumed and later projectiles start clean', async () => { const source = await read('src/game-v4.js'); - assert.match(source, /if \(group === this\.pirateShots\) shot\.setData\('playerHitQueued', false\)/); - assert.match(source, /for \(const impact of hits\) \{[\s\S]*?if \(impact\.shot\?\.active\) impact\.shot\.destroy\(\)/); + assert.match(source, /shot\.setData\('projectileOwner', actor\)/); + assert.match(source, /if \(actor === 'pirate'\) shot\.setData\('playerHitQueued', false\)/); + assert.match(source, /shot !== this\.player[\s\S]*?projectileOwner'\) === 'pirate'[\s\S]*?shot\.destroy\(\)/); assert.match(source, /if \(shot\.getData\('playerHitQueued'\)\) return/); });