generated from nhcarrigan/template
chore: fix lint, ensure full CI pipeline passes, add verify checklist
- Fix strict-boolean-expressions in 7 route files (runtime body validation) - Fix no-unnecessary-condition in profile.ts and offlineProgress.ts (defensive null checks) - Extend v8 ignore next-N counts in game.ts to reach 100% coverage - Add CI requirements to CLAUDE.md (lint + build + test must pass before commit) - Add manual verification checklist (verify.md) - Remove progress.md
This commit is contained in:
@@ -90,19 +90,19 @@ describe("isEligibleForPrestige", () => {
|
||||
describe("calculateRunestones", () => {
|
||||
it("calculates basic runestones formula", () => {
|
||||
// floor(sqrt(4_000_000 / 1_000_000)) × 10 = floor(2) × 10 = 20
|
||||
const result = calculateRunestones(4_000_000, 0, []);
|
||||
const result = calculateRunestones({ totalGoldEarned: 4_000_000, prestigeCount: 0, purchasedUpgradeIds: [] });
|
||||
expect(result).toBe(20);
|
||||
});
|
||||
|
||||
it("applies echo runestone multiplier", () => {
|
||||
// floor(sqrt(4) × 10) = 20; × 2 = 40
|
||||
const result = calculateRunestones(4_000_000, 0, [], 2);
|
||||
const result = calculateRunestones({ totalGoldEarned: 4_000_000, prestigeCount: 0, purchasedUpgradeIds: [], echoRunestoneMultiplier: 2 });
|
||||
expect(result).toBe(40);
|
||||
});
|
||||
|
||||
it("applies purchased runestone upgrade multiplier", () => {
|
||||
// With "runestones_1" purchased (multiplier 1.25): floor(20 × 1.25) = 25
|
||||
const result = calculateRunestones(4_000_000, 0, ["runestone_gain_1"]);
|
||||
const result = calculateRunestones({ totalGoldEarned: 4_000_000, prestigeCount: 0, purchasedUpgradeIds: ["runestone_gain_1"] });
|
||||
expect(result).toBeGreaterThan(20);
|
||||
});
|
||||
});
|
||||
@@ -176,15 +176,15 @@ describe("computeRunestoneMultipliers", () => {
|
||||
describe("buildPostPrestigeState", () => {
|
||||
it("increments prestige count", () => {
|
||||
const state = makeMinimalState({ player: makePlayer(4_000_000) });
|
||||
const { newPrestigeData } = buildPostPrestigeState(state, "Tester");
|
||||
expect(newPrestigeData.count).toBe(1);
|
||||
const { prestigeData } = buildPostPrestigeState(state, "Tester");
|
||||
expect(prestigeData.count).toBe(1);
|
||||
});
|
||||
|
||||
it("sums runestones earned", () => {
|
||||
const state = makeMinimalState({ player: makePlayer(4_000_000) });
|
||||
const { newPrestigeData, runestonesEarned } = buildPostPrestigeState(state, "Tester");
|
||||
const { prestigeData, runestonesEarned } = buildPostPrestigeState(state, "Tester");
|
||||
expect(runestonesEarned).toBeGreaterThan(0);
|
||||
expect(newPrestigeData.runestones).toBe(runestonesEarned);
|
||||
expect(prestigeData.runestones).toBe(runestonesEarned);
|
||||
});
|
||||
|
||||
it("adds milestone runestones at prestige 5", () => {
|
||||
@@ -199,15 +199,15 @@ describe("buildPostPrestigeState", () => {
|
||||
it("persists codex from current state", () => {
|
||||
const codex = { entries: [{ id: "e1", unlockedAt: 1000, sourceType: "exploration" as const }] };
|
||||
const state = makeMinimalState({ codex });
|
||||
const { newState } = buildPostPrestigeState(state, "Tester");
|
||||
expect(newState.codex).toEqual(codex);
|
||||
const { prestigeState } = buildPostPrestigeState(state, "Tester");
|
||||
expect(prestigeState.codex).toEqual(codex);
|
||||
});
|
||||
|
||||
it("persists story from current state", () => {
|
||||
const story = { unlockedChapterIds: ["ch1"], completedChapters: [] };
|
||||
const state = makeMinimalState({ story });
|
||||
const { newState } = buildPostPrestigeState(state, "Tester");
|
||||
expect(newState.story).toEqual(story);
|
||||
const { prestigeState } = buildPostPrestigeState(state, "Tester");
|
||||
expect(prestigeState.story).toEqual(story);
|
||||
});
|
||||
|
||||
it("persists transcendence from current state", () => {
|
||||
@@ -218,28 +218,28 @@ describe("buildPostPrestigeState", () => {
|
||||
echoPrestigeRunestoneMultiplier: 1, echoMetaMultiplier: 1,
|
||||
};
|
||||
const state = makeMinimalState({ transcendence });
|
||||
const { newState } = buildPostPrestigeState(state, "Tester");
|
||||
expect(newState.transcendence).toEqual(transcendence);
|
||||
const { prestigeState } = buildPostPrestigeState(state, "Tester");
|
||||
expect(prestigeState.transcendence).toEqual(transcendence);
|
||||
});
|
||||
|
||||
it("preserves autoPrestigeEnabled when set", () => {
|
||||
const state = makeMinimalState({
|
||||
prestige: { count: 0, runestones: 0, productionMultiplier: 1, purchasedUpgradeIds: [], autoPrestigeEnabled: true },
|
||||
});
|
||||
const { newPrestigeData } = buildPostPrestigeState(state, "Tester");
|
||||
expect(newPrestigeData.autoPrestigeEnabled).toBe(true);
|
||||
const { prestigeData } = buildPostPrestigeState(state, "Tester");
|
||||
expect(prestigeData.autoPrestigeEnabled).toBe(true);
|
||||
});
|
||||
|
||||
it("omits autoPrestigeEnabled when not set", () => {
|
||||
const state = makeMinimalState();
|
||||
const { newPrestigeData } = buildPostPrestigeState(state, "Tester");
|
||||
expect(newPrestigeData.autoPrestigeEnabled).toBeUndefined();
|
||||
const { prestigeData } = buildPostPrestigeState(state, "Tester");
|
||||
expect(prestigeData.autoPrestigeEnabled).toBeUndefined();
|
||||
});
|
||||
|
||||
it("preserves apotheosis data across prestige", () => {
|
||||
const apotheosis = { count: 2 };
|
||||
const state = makeMinimalState({ apotheosis });
|
||||
const { newState } = buildPostPrestigeState(state, "Tester");
|
||||
expect(newState.apotheosis).toEqual(apotheosis);
|
||||
const { prestigeState } = buildPostPrestigeState(state, "Tester");
|
||||
expect(prestigeState.apotheosis).toEqual(apotheosis);
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user