Skip to main content

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

FileTests
pacing-manager.spec.tsPhase cycling, trail markers, difficulty scaling
enemy-registry.spec.tsConfig lookups, trigger radius, speed values
lod-map.spec.tsLOD template parsing, naming conventions
petal-colors.spec.tsColor palette generation
quirkymal-state-machine.spec.tsAnimation state transitions
seeded-random.spec.tsDeterministic RNG consistency
spawn-factory.spec.tsEnemy slot generation per pacing phase
quadtree.spec.tsRectangle subtraction, intersection
ecs-utils.spec.tsECS 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.