test-sequences.ts
PURPOSE
Pre-built named test sequences consumed by the playground ScenarioRunner. Each sequence is an ordered list of test steps (scenarioId + timeout + speed + optional overrides) that the runner executes back-to-back to validate artifacts, weapons, and stress behavior.
OWNS
ARTIFACT_SUITE_T0—TestSequencerunning every artifact scenario fromARTIFACT_TEST_SCENARIOSat tier 0 (default grant).ARTIFACT_SUITE_T3— same scenario list, with apostStartoverride injecting agrant_artifactstep at tier 3 (legendary). Artifact id derived by stripping theart-test-prefix from the scenario id.WEAPON_DPS_SWEEP— one step per non-disabled weapon inWEAPONS; reusesdamage-testscenario and overridesship.weaponsto[{ id, level: 10 }].STRESS_SUITE—horde-peakscenario atspeedMult: 1withworld.enemyCountMultcycling through a small set of multipliers.TEST_SEQUENCES— flat array registry of all four sequences above.TEST_SEQUENCE_MAP—Record<string, TestSequence>keyed byseq.id, populated at module load.listTestSequences()— returns the list of registered sequence ids.
READS FROM
./scenario-types— type-only import ofTestSequence../artifact-scenarios—ARTIFACT_TEST_SCENARIOSarray; one step is emitted per scenario for both artifact suites.../data/weapons—WEAPONStable, loaded viarequire()inside atry/catchto dodge a circular-dep load order. The catch swallows the error and leaves_weaponIdsas[](silent empty sweep on failure).- Filters
WEAPONSby!w.disabledand maps tow.weaponId.
PUSHES TO
Nothing at module scope. Exports are pulled by the playground / ScenarioRunner UI layer to populate sequence pickers and to drive batch runs. Step overrides are passed through to the runner verbatim — this file does not interpret them.
DOES NOT
- Does not execute steps, time them, or report results — that’s the
ScenarioRunner. - Does not define scenarios themselves; only references them by
scenarioId. - Does not validate that referenced scenarios or weapon ids exist.
- Does not gate on weapon
disabledsemantics beyond the boolean filter. - Does not surface the
require()failure — silently empties the weapon sweep.
Signals
None. Pure data module; no events, no store writes, no telemetry.
Entry points
- Module-level constant exports (
ARTIFACT_SUITE_T0,ARTIFACT_SUITE_T3,WEAPON_DPS_SWEEP,STRESS_SUITE,TEST_SEQUENCES,TEST_SEQUENCE_MAP). listTestSequences()for UI enumeration.
Pattern notes
- Circular-dep dodge via
require()+ try/catch. The weapon list is loaded lazily through CommonJSrequireto avoid an ESM import cycle. The empty catch is a deliberate silent fallback — at boundary with the data module, but note this violates the “crash on bad data” preference for internal failures. IfWEAPONSever fails to load,WEAPON_DPS_SWEEPbecomes a no-op with no warning. - Convention coupling —
art-test-<artifactId>.ARTIFACT_SUITE_T3synthesizes the artifact id by stripping theart-test-prefix from each scenario id. Renaming artifact scenarios inartifact-scenarios.tswithout preserving this prefix will silently grant the wrong artifact (or nothing). - Step
speedMultvs sequencedefaultSpeed. Both are set on artifact and weapon sequences; stress suite usesspeedMult: 1on every step anddefaultSpeed: 1to keep timing realistic under load. as conston override step types.grant_artifactis narrowed to a literal in thepostStartoverride array so the override conforms to the discriminated union expected by the runner.- Registry is built once at module load.
TEST_SEQUENCE_MAPis populated by a top-levelforloop, not lazily — adding a sequence requires appending to theTEST_SEQUENCESarray.
EXTRACT-CANDIDATE
- The silent
try/catcharoundrequire('../data/weapons')is a recurring pattern in playground/testing code to dodge load-order issues. If it shows up elsewhere, extract a sharedtryRequire<T>(path, fallback)helper with a single logging policy (or, preferred per project rules, replace with a properly ordered import and remove the fallback). - The
art-test-<id>prefix convention is implicit shared knowledge betweenartifact-scenarios.tsand this file. Worth lifting to a single named constant + helper (artifactIdFromScenarioId) inscenario-types.tsso the coupling is explicit and grep-able.