From 213425e6c90998faa6f80fcd5430dbb9ecf8e499 Mon Sep 17 00:00:00 2001 From: n8n-gitea Date: Tue, 19 May 2026 12:34:58 +0200 Subject: [PATCH] fix(tests): remove broken test index files and fix computed-stats import --- docs/circular-deps.txt | 4 ++-- docs/dependency-graph.json | 7 ++++++- docs/project-structure.txt | 3 --- src/lib/game/__tests__/bug-fixes.test.ts | 11 ++++------- src/lib/game/store.test.ts | 20 -------------------- src/lib/game/stores.test.ts | 18 ------------------ src/lib/game/stores/index.test.ts | 19 ------------------- 7 files changed, 12 insertions(+), 70 deletions(-) delete mode 100755 src/lib/game/store.test.ts delete mode 100755 src/lib/game/stores.test.ts delete mode 100755 src/lib/game/stores/index.test.ts diff --git a/docs/circular-deps.txt b/docs/circular-deps.txt index 2267a36..17531c5 100644 --- a/docs/circular-deps.txt +++ b/docs/circular-deps.txt @@ -1,8 +1,8 @@ # Circular Dependencies -Generated: 2026-05-19T09:44:29.294Z +Generated: 2026-05-19T10:06:50.403Z Found: 3 circular chain(s) — these MUST be fixed before modifying involved files. -1. Processed 121 files (1.2s) (28 warnings) +1. Processed 121 files (1.3s) (28 warnings) 2. 1) data/equipment/index.ts > data/equipment/utils.ts 3. 2) data/golems/index.ts > data/golems/utils.ts diff --git a/docs/dependency-graph.json b/docs/dependency-graph.json index e4def9b..f4f78ae 100644 --- a/docs/dependency-graph.json +++ b/docs/dependency-graph.json @@ -1,6 +1,6 @@ { "_meta": { - "generated": "2026-05-19T09:44:27.808Z", + "generated": "2026-05-19T10:06:48.891Z", "description": "Import dependency graph for src/lib/game. Keys are files, values are arrays of files they import.", "usage": "To find what a file affects, search for its path in the VALUES. To find what a file depends on, look at its KEY entry." }, @@ -479,9 +479,14 @@ "stores/gameStore.ts": [ "constants.ts", "data/attunements.ts", + "effects.ts", + "effects/discipline-effects.ts", "effects/special-effects.ts", + "effects/upgrade-effects.types.ts", "stores/attunementStore.ts", "stores/combatStore.ts", + "stores/craftingStore.ts", + "stores/discipline-slice.ts", "stores/gameActions.ts", "stores/gameLoopActions.ts", "stores/manaStore.ts", diff --git a/docs/project-structure.txt b/docs/project-structure.txt index e92c3bc..39a5463 100644 --- a/docs/project-structure.txt +++ b/docs/project-structure.txt @@ -249,7 +249,6 @@ Mana-Loop/ │ │ │ ├── gameHooks.ts │ │ │ ├── gameLoopActions.ts │ │ │ ├── gameStore.ts -│ │ │ ├── index.test.ts │ │ │ ├── index.ts │ │ │ ├── manaStore.ts │ │ │ ├── prestigeStore.ts @@ -284,9 +283,7 @@ Mana-Loop/ │ │ ├── crafting-slice.ts │ │ ├── crafting-utils.ts │ │ ├── effects.ts -│ │ ├── store.test.ts │ │ ├── store.ts -│ │ ├── stores.test.ts │ │ └── types.ts │ └── utils.ts ├── test-results/ diff --git a/src/lib/game/__tests__/bug-fixes.test.ts b/src/lib/game/__tests__/bug-fixes.test.ts index 38bc04a..bddd230 100755 --- a/src/lib/game/__tests__/bug-fixes.test.ts +++ b/src/lib/game/__tests__/bug-fixes.test.ts @@ -2,6 +2,7 @@ import { describe, it, expect } from 'vitest'; import { calculateEffectCapacityCost, ENCHANTMENT_EFFECTS } from '../data/enchantment-effects'; import { EQUIPMENT_TYPES } from '../data/equipment'; import { ATTUNEMENTS_DEF, getAttunementConversionRate } from '../data/attunements'; +import { getFloorMaxHP } from '../utils'; describe('Enchantment Capacity Validation', () => { it('should calculate capacity cost for single stack effects', () => { @@ -82,23 +83,19 @@ describe('Attunement Mana Type Unlocking', () => { }); describe('Floor HP State', () => { - it('should have getFloorMaxHP function that returns positive values', async () => { - const { getFloorMaxHP } = await import('../computed-stats'); - + it('should have getFloorMaxHP function that returns positive values', () => { for (let floor = 1; floor <= 100; floor++) { const hp = getFloorMaxHP(floor); expect(hp).toBeGreaterThan(0); } }); - it('should scale HP correctly with floor progression', async () => { - const { getFloorMaxHP } = await import('../computed-stats'); - + it('should scale HP correctly with floor progression', () => { const hp1 = getFloorMaxHP(1); const hp10 = getFloorMaxHP(10); const hp50 = getFloorMaxHP(50); const hp100 = getFloorMaxHP(100); - + expect(hp10).toBeGreaterThan(hp1); expect(hp50).toBeGreaterThan(hp10); expect(hp100).toBeGreaterThan(hp50); diff --git a/src/lib/game/store.test.ts b/src/lib/game/store.test.ts deleted file mode 100755 index 3dc07f7..0000000 --- a/src/lib/game/store.test.ts +++ /dev/null @@ -1,20 +0,0 @@ -/** - * Unit Tests for Mana Loop Game Logic - * - * This file contains comprehensive tests for the game's core mechanics. - * - * This file has been refactored - individual test suites have been moved to - * the store-tests/ directory. This file re-exports all tests for convenience. - */ - -// Re-export all test modules -export * from './store-tests/formatting.test'; -export * from './store-tests/floor.test'; -export * from './store-tests/mana-calculation.test'; -export * from './store-tests/damage-calculation.test'; -export * from './store-tests/insight-meditation-incursion.test'; -export * from './store-tests/spell-cost.test'; -export * from './store-tests/study-speed.test'; -export * from './store-tests/game-constants.test'; -export * from './store-tests/element-recipes.test'; -export * from './store-tests/integration.test'; diff --git a/src/lib/game/stores.test.ts b/src/lib/game/stores.test.ts deleted file mode 100755 index 8544af4..0000000 --- a/src/lib/game/stores.test.ts +++ /dev/null @@ -1,18 +0,0 @@ -/** - * Stores Tests - Main Index - * - * This file re-exports all individual store test files from stores.test.ts - * Each test file is focused on a specific store or functionality. - * - * Original file: stores.test.ts (494 lines) - * Refactored into 6 smaller test files. - */ - -import './stores-split-tests/mana-store.test'; -import './stores-split-tests/skill-store.test'; -import './stores-split-tests/prestige-store.test'; -import './stores-split-tests/combat-store.test'; -import './stores-split-tests/ui-store.test'; -import './stores-split-tests/integration.test'; - -console.log('✅ All stores tests complete (refactored from 494 lines to 6 focused test files).'); diff --git a/src/lib/game/stores/index.test.ts b/src/lib/game/stores/index.test.ts deleted file mode 100755 index 6d1a00e..0000000 --- a/src/lib/game/stores/index.test.ts +++ /dev/null @@ -1,19 +0,0 @@ -/** - * Stores Index Tests - Main Index - * - * This file re-exports all individual test files for the stores index. - * Each test file is focused on a specific area of functionality. - * - * Original file: stores/index.test.ts (571 lines) - * Refactored into 7 smaller test files. - */ - -import '../index-tests/utility-functions.test'; -import '../index-tests/mana-calculations.test'; -import '../index-tests/combat-calculations.test'; -import '../index-tests/study-speed.test'; -import '../index-tests/meditation-insight-incursion.test'; -import '../index-tests/spell-cost.test'; -import '../index-tests/definitions.test'; - -console.log('✅ All stores index tests complete (refactored from 571 lines to 7 focused test files).');