Testing
Test Runner
Tests use TestEZ and run in Studio when the RunTests attribute is set on ServerScriptService.
ServerScriptService:SetAttribute("RunTests", true)
The test runner (src/server/test-runner.server.ts) bootstraps TestEZ on startup if the attribute is present.
Test Files
| File | Tests |
|---|---|
pacing-manager.spec.ts | Phase cycling, trail markers, difficulty scaling |
enemy-registry.spec.ts | Config lookups, trigger radius, speed values |
lod-map.spec.ts | LOD template parsing, naming conventions |
petal-colors.spec.ts | Color palette generation |
quirkymal-state-machine.spec.ts | Animation state transitions |
seeded-random.spec.ts | Deterministic RNG consistency |
spawn-factory.spec.ts | Enemy slot generation per pacing phase |
quadtree.spec.ts | Rectangle subtraction, intersection |
ecs-utils.spec.ts | ECS utility functions |
Writing Tests
Tests follow TestEZ conventions:
export = () => {
describe("PacingManager", () => {
it("should start on Calm phase", () => {
const pm = new PacingManager();
expect(pm.getPacingForChunk(0).phase).to.equal("Calm");
});
it("should cap difficulty at max", () => {
const pm = new PacingManager();
// chunkIndex 80 → trailMarker = 41 → multiplier capped at 3.0
expect(pm.getPacingForChunk(80).difficultyMultiplier).to.equal(3);
});
});
};
Debug UI Testing
The debug UI provides runtime testing tools:
- Spawn specific enemy types at will
- Teleport to any chunk
- Toggle god mode
- Force day/night
- Trigger PathMonster sweeps
- View enemy lists and pacing data
See Debug UI for details.