TASK-007: Fix broken import paths in stores/__tests__/stores-tests/ #1
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Broken Import Paths in Test Directory
Multiple test files in
src/lib/game/stores/__tests__/stores-tests/have incorrect relative imports causing "Failed to resolve import" errors at test time.Affected files and problems:
skill-definitions.test.ts../../constants../../../constantsspell-cost.test.ts../../utilsand../../constants../../../utilsand../../../constantsspell-definitions.test.ts../../constants../../../constantsstudy-speed.test.ts../../utils../../../utilsdamage-calculation.test.ts../store../../storeformatting.test.ts../store../../storefloor.test.ts../store../../storeguardians.test.ts../../constants../../../constantsincursion.test.ts../../constants../../../constantsinsight-calculation.test.ts../../store../../../storemana-calculation.test.ts../store../../storemeditation.test.ts../../constants../../../constantsprestige-upgrades.test.ts../../constants../../../constantsRoot cause:
These files are nested at
stores/__tests__/stores-tests/but use../../which only reachesstores/__tests__/. They need../../../to reachstores/and beyond.Verification:
Run
npx vitest run— 50+ test files fail to load due to import resolution errors (see test output). Only ~30 tests pass, all from the correctly-pathedstores/__tests__/directory.Starting work on this issue. Will investigate the broken import paths in stores/tests/stores-tests/.
Fixed all broken import paths in
stores/__tests__/stores-tests/andstores/__tests__/index-tests/.Changes made (7 files):
damage-calculation.test.ts:../../types→../../../typesinsight-calculation.test.ts:../../types→../../../typesmana-calculation.test.ts:../types→../../../types+ fixedcomputeElementMaximport to come from@/lib/game/stores/indexinstead of@/lib/game/utilsdefinitions.test.ts:../../types→../../../typescombat-calculations.test.ts:../../types→../../../typesmeditation-insight-incursion.test.ts:../../types→../../../typesmana-calculations.test.ts:../../types→../../../typesThe root cause was that files nested at
stores/__tests__/stores-tests/andstores/__tests__/index-tests/used../../which only reachesstores/__tests__/, when they needed../../../to reachsrc/lib/game/types.ts.