Fixed unit tests to not explode in dramatic fashion

This commit is contained in:
Bertie690 2025-09-21 18:58:16 -04:00
parent 88e8d64790
commit 55782e5dbc

View File

@ -62,14 +62,14 @@ describe("Utils - Phase Interceptor - Unit", () => {
*/ */
function setPhases(...phases: [Constructor<mockPhase>, ...Constructor<mockPhase>[]]) { function setPhases(...phases: [Constructor<mockPhase>, ...Constructor<mockPhase>[]]) {
game.scene.phaseManager.clearAllPhases(); game.scene.phaseManager.clearAllPhases();
game.scene.phaseManager.phaseQueue = phases.map(m => new m()) as Phase[]; for (const phase of phases) {
game.scene.phaseManager.unshiftPhase(new phase());
}
game.scene.phaseManager.shiftPhase(); // start the thing going game.scene.phaseManager.shiftPhase(); // start the thing going
} }
function getQueuedPhases(): string[] { function getQueuedPhases(): string[] {
return game.scene.phaseManager["phaseQueuePrepend"] return game.scene.phaseManager["phaseQueue"]["levels"].flat(2).map(p => p.phaseName);
.concat(game.scene.phaseManager.phaseQueue)
.map(p => p.phaseName);
} }
function expectAtPhase(phaseName: string) { function expectAtPhase(phaseName: string) {