aether-shards/test/core/GameLoop/stop.test.js
Matthew Mone 2c86d674f4 Add mission debrief and procedural mission generation features
- Introduce the MissionDebrief component to display after-action reports, including XP, rewards, and squad status.
- Implement the MissionGenerator class to create procedural side missions, enhancing replayability and resource management.
- Update mission schema to include mission objects for INTERACT objectives, improving mission complexity.
- Enhance GameLoop and MissionManager to support new mission features and interactions.
- Add tests for MissionDebrief and MissionGenerator to ensure functionality and integration within the game architecture.
2026-01-01 16:08:54 -08:00

43 lines
980 B
JavaScript

import { expect } from "@esm-bundle/chai";
import sinon from "sinon";
import { GameLoop } from "../../../src/core/GameLoop.js";
import {
createGameLoopSetup,
cleanupGameLoop,
} from "./helpers.js";
describe("Core: GameLoop - Stop", function () {
this.timeout(30000);
let gameLoop;
let container;
beforeEach(() => {
const setup = createGameLoopSetup();
gameLoop = setup.gameLoop;
container = setup.container;
gameLoop.init(container);
});
afterEach(() => {
cleanupGameLoop(gameLoop, container);
});
it("CoA 4: stop() should halt animation loop", (done) => {
gameLoop.isRunning = true;
// Spy on animate
const spy = sinon.spy(gameLoop, "animate");
gameLoop.stop();
// Wait a short duration to ensure loop doesn't fire
// Using setTimeout instead of requestAnimationFrame for reliability in headless env
setTimeout(() => {
expect(gameLoop.isRunning).to.be.false;
done();
}, 50);
});
});