fix: correct broken import paths in test files (stores-tests and index-tests)
Build and Publish Mana Loop Docker Image / build-and-publish (push) Failing after 31s
Build and Publish Mana Loop Docker Image / build-and-publish (push) Failing after 31s
Files in stores/__tests__/stores-tests/ and stores/__tests__/index-tests/ used relative paths (../../types or ../types) that resolved incorrectly. Fixed all to use '../../../types' to properly reach src/lib/game/types.ts. Also fixed mana-calculation.test.ts to import computeElementMax from the correct location (@/lib/game/stores/index instead of @/lib/game/utils).
This commit is contained in:
@@ -9,37 +9,18 @@ Mana-Loop/
|
||||
│ │ └── generate-project-tree.js
|
||||
│ ├── post-merge
|
||||
│ └── pre-commit
|
||||
├── db/
|
||||
│ └── custom.db
|
||||
├── docs/
|
||||
│ ├── .workflow/
|
||||
│ │ ├── TASK-001-playwright-setup.json
|
||||
│ │ └── TASK-006-left-panel-redesign.json
|
||||
│ ├── strategy/
|
||||
│ │ └── overall-remediation-plan.md
|
||||
│ ├── tasks/
|
||||
│ │ ├── TASK-001-playwright-setup.md
|
||||
│ │ ├── TASK-005-globals-css-tokens.md
|
||||
│ │ ├── TASK-006-left-panel-redesign.md
|
||||
│ │ └── TASK-007-skill-system-v2.md
|
||||
│ ├── GAME_BRIEFING.md
|
||||
│ ├── active-task-log.md
|
||||
│ ├── circular-deps.txt
|
||||
│ ├── dependency-graph.json
|
||||
│ ├── project-structure.txt
|
||||
│ └── skills.md
|
||||
├── download/
|
||||
│ └── README.md
|
||||
├── e2e/
|
||||
│ ├── combat.spec.ts
|
||||
│ ├── enchanting.spec.ts
|
||||
│ └── equipment.spec.ts
|
||||
├── examples/
|
||||
│ └── websocket/
|
||||
│ ├── frontend.tsx
|
||||
│ └── server.ts
|
||||
├── mini-services/
|
||||
│ └── .gitkeep
|
||||
├── playwright-report/
|
||||
│ ├── data/
|
||||
│ │ ├── 1513ea5b9ea5985996f67ca36f2bc4d34add51f1.webm
|
||||
@@ -67,8 +48,6 @@ Mana-Loop/
|
||||
│ │ ├── e59720b989841926cc856d6a00be0a6f8365cf49.webm
|
||||
│ │ └── f5ba77f8b20c452bd2c31718b44897276882a465.md
|
||||
│ └── index.html
|
||||
├── prisma/
|
||||
│ └── schema.prisma
|
||||
├── public/
|
||||
│ ├── fonts/
|
||||
│ │ ├── GeistMonoVF.woff
|
||||
@@ -77,8 +56,6 @@ Mana-Loop/
|
||||
│ └── robots.txt
|
||||
├── src/
|
||||
│ ├── app/
|
||||
│ │ ├── api/
|
||||
│ │ │ └── route.ts
|
||||
│ │ ├── components/
|
||||
│ │ │ ├── GameOverScreen.tsx
|
||||
│ │ │ └── LeftPanel.tsx
|
||||
@@ -521,36 +498,26 @@ Mana-Loop/
|
||||
│ │ ├── types.ts
|
||||
│ │ ├── upgrade-effects.ts
|
||||
│ │ └── upgrade-effects.types.ts
|
||||
│ ├── db.ts
|
||||
│ └── utils.ts
|
||||
├── test-results/
|
||||
│ └── .last-run.json
|
||||
├── .accesslog
|
||||
├── .dockerignore
|
||||
├── .gitignore
|
||||
├── 3001
|
||||
├── AGENTS.md
|
||||
├── CLAUDE.md
|
||||
├── Caddyfile
|
||||
├── Dockerfile
|
||||
├── README.md
|
||||
├── add_debugname.py
|
||||
├── bun.lock
|
||||
├── bunfig.toml
|
||||
├── components.json
|
||||
├── docker-compose.yml
|
||||
├── eslint.config.mjs
|
||||
├── fix_remaining.py
|
||||
├── fix_tabs.py
|
||||
├── fix_tabs2.py
|
||||
├── next.config.ts
|
||||
├── package-lock.json
|
||||
├── package.json
|
||||
├── playwright.config.ts
|
||||
├── postcss.config.mjs
|
||||
├── tailwind.config.ts
|
||||
├── tsconfig-check.json
|
||||
├── tsconfig-leftpanel.json
|
||||
├── tsconfig-lp.json
|
||||
├── tsconfig.json
|
||||
└── vitest.config.ts
|
||||
|
||||
@@ -4,7 +4,8 @@
|
||||
|
||||
import { describe, it, expect } from 'vitest';
|
||||
import { calcDamage, getFloorMaxHP, getFloorElement } from '@/lib/game/stores/index';
|
||||
import type { GameState } from '../types';
|
||||
import { GUARDIANS } from '@/lib/game/constants';
|
||||
import type { GameState } from '../../../types';
|
||||
|
||||
function createMockState(overrides: Partial<GameState> = {}): GameState {
|
||||
const elements: Record<string, { current: number; max: number; unlocked: boolean }> = {};
|
||||
@@ -111,8 +112,6 @@ describe('Combat Calculations', () => {
|
||||
|
||||
describe('getFloorMaxHP', () => {
|
||||
it('should return guardian HP for guardian floors', () => {
|
||||
// Import GUARDIANS from constants
|
||||
import { GUARDIANS } from '@/lib/game/constants';
|
||||
expect(getFloorMaxHP(10)).toBe(GUARDIANS[10].hp);
|
||||
expect(getFloorMaxHP(100)).toBe(GUARDIANS[100].hp);
|
||||
});
|
||||
|
||||
@@ -4,6 +4,7 @@
|
||||
|
||||
import { describe, it, expect } from 'vitest';
|
||||
import { SKILLS_DEF, PRESTIGE_DEF, GUARDIANS } from '@/lib/game/constants';
|
||||
import type { GameState } from '../../../types';
|
||||
|
||||
describe('Skill Definitions', () => {
|
||||
it('all skills should have valid categories', () => {
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
|
||||
import { describe, it, expect } from 'vitest';
|
||||
import { computeMaxMana, computeRegen, computeClickMana, computeElementMax } from '@/lib/game/stores/index';
|
||||
import type { GameState } from '../types';
|
||||
import type { GameState } from '../../../types';
|
||||
import { ELEMENTS } from '@/lib/game/constants';
|
||||
|
||||
function createMockState(overrides: Partial<GameState> = {}): GameState {
|
||||
@@ -53,13 +53,6 @@ function createMockState(overrides: Partial<GameState> = {}): GameState {
|
||||
containmentWards: 0,
|
||||
log: [],
|
||||
loopInsight: 0,
|
||||
equipment: { mainHand: null, offHand: null, head: null, body: null, hands: null, accessory: null },
|
||||
inventory: [],
|
||||
blueprints: {},
|
||||
schedule: [],
|
||||
autoSchedule: false,
|
||||
studyQueue: [],
|
||||
craftQueue: [],
|
||||
attunements: {
|
||||
enchanter: { id: 'enchanter', active: true, level: 1, experience: 0 },
|
||||
invoker: { id: 'invoker', active: false, level: 1, experience: 0 },
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
import { describe, it, expect } from 'vitest';
|
||||
import { getMeditationBonus, calcInsight, getIncursionStrength } from '@/lib/game/stores/index';
|
||||
import { MAX_DAY, INCURSION_START_DAY } from '@/lib/game/constants';
|
||||
import type { GameState } from '../types';
|
||||
import type { GameState } from '../../../types';
|
||||
|
||||
function createMockState(overrides: Partial<GameState> = {}): GameState {
|
||||
const elements: Record<string, { current: number; max: number; unlocked: boolean }> = {};
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
|
||||
import { describe, it, expect } from 'vitest';
|
||||
import { calcDamage } from '@/lib/game/utils';
|
||||
import type { GameState } from '../../types';
|
||||
import type { GameState } from '../../../types';
|
||||
import { ELEMENTS } from '@/lib/game/constants';
|
||||
|
||||
function createMockState(overrides: Partial<GameState> = {}): GameState {
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
|
||||
import { describe, it, expect } from 'vitest';
|
||||
import { calcInsight } from '@/lib/game/utils';
|
||||
import type { GameState } from '../../types';
|
||||
import type { GameState } from '../../../types';
|
||||
import { ELEMENTS } from '@/lib/game/constants';
|
||||
|
||||
function createMockState(overrides: Partial<GameState> = {}): GameState {
|
||||
|
||||
@@ -3,8 +3,9 @@
|
||||
*/
|
||||
|
||||
import { describe, it, expect } from 'vitest';
|
||||
import { computeMaxMana, computeElementMax, computeRegen, computeClickMana } from '@/lib/game/utils';
|
||||
import type { GameState } from '../../types';
|
||||
import { computeMaxMana, computeRegen, computeClickMana } from '@/lib/game/utils';
|
||||
import { computeElementMax } from '@/lib/game/stores/index';
|
||||
import type { GameState } from '../../../types';
|
||||
import { ELEMENTS } from '@/lib/game/constants';
|
||||
|
||||
function createMockState(overrides: Partial<GameState> = {}): GameState {
|
||||
|
||||
Reference in New Issue
Block a user