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,14 +4,15 @@
|
||||
|
||||
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 }> = {};
|
||||
['fire', 'water', 'air', 'earth', 'light', 'dark', 'death', 'transference', 'metal', 'sand', 'crystal', 'stellar', 'void', 'lightning'].forEach((k) => {
|
||||
elements[k] = { current: 0, max: 10, unlocked: ['fire', 'water', 'air', 'earth'].includes(k) };
|
||||
});
|
||||
|
||||
|
||||
return {
|
||||
day: 1,
|
||||
hour: 0,
|
||||
@@ -35,7 +36,7 @@ function createMockState(overrides: Partial<GameState> = {}): GameState {
|
||||
activeSpell: 'manaBolt',
|
||||
currentAction: 'meditate',
|
||||
castProgress: 0,
|
||||
spells: {
|
||||
spells: {
|
||||
manaBolt: { learned: true, level: 1, studyProgress: 0 },
|
||||
fireball: { learned: true, level: 1, studyProgress: 0 },
|
||||
waterJet: { learned: true, level: 1, studyProgress: 0 },
|
||||
@@ -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);
|
||||
});
|
||||
@@ -145,4 +144,4 @@ describe('Combat Calculations', () => {
|
||||
});
|
||||
});
|
||||
|
||||
console.log('✅ Combat calculation tests defined.');
|
||||
console.log('✅ Combat calculation tests defined.');
|
||||
@@ -4,10 +4,11 @@
|
||||
|
||||
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', () => {
|
||||
const validCategories = ['mana', 'study', 'research', 'ascension', 'enchant',
|
||||
const validCategories = ['mana', 'study', 'research', 'ascension', 'enchant',
|
||||
'effectResearch', 'invocation', 'pact', 'fabrication', 'golemancy', 'craft', 'hybrid'];
|
||||
Object.values(SKILLS_DEF).forEach(skill => {
|
||||
expect(validCategories).toContain(skill.cat);
|
||||
@@ -94,4 +95,4 @@ describe('Guardian Definitions', () => {
|
||||
});
|
||||
});
|
||||
|
||||
console.log('✅ Skill, prestige, and guardian definition tests defined.');
|
||||
console.log('✅ Skill, prestige, and guardian definition tests defined.');
|
||||
@@ -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 {
|
||||
@@ -12,7 +12,7 @@ function createMockState(overrides: Partial<GameState> = {}): GameState {
|
||||
Object.keys(ELEMENTS).forEach((k) => {
|
||||
elements[k] = { current: 0, max: 10, unlocked: ['fire', 'water', 'air', 'earth'].includes(k) };
|
||||
});
|
||||
|
||||
|
||||
return {
|
||||
day: 1,
|
||||
hour: 0,
|
||||
@@ -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 },
|
||||
@@ -92,7 +85,7 @@ describe('Mana Calculations', () => {
|
||||
const state = createMockState({ prestigeUpgrades: { manaWell: 3 } });
|
||||
expect(computeMaxMana(state)).toBe(100 + 3 * 500);
|
||||
});
|
||||
|
||||
|
||||
it('should stack manaWell skill and prestige', () => {
|
||||
const state = createMockState({
|
||||
skills: { manaWell: 5 },
|
||||
@@ -168,4 +161,4 @@ describe('Mana Calculations', () => {
|
||||
});
|
||||
});
|
||||
|
||||
console.log('✅ Mana calculation tests defined.');
|
||||
console.log('✅ Mana calculation tests defined.');
|
||||
@@ -5,14 +5,14 @@
|
||||
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 }> = {};
|
||||
['fire', 'water', 'air', 'earth', 'light', 'dark', 'death', 'transference'].forEach((k) => {
|
||||
elements[k] = { current: 0, max: 10, unlocked: ['fire', 'water', 'air', 'earth'].includes(k) };
|
||||
});
|
||||
|
||||
|
||||
return {
|
||||
day: 1,
|
||||
hour: 0,
|
||||
@@ -80,7 +80,7 @@ describe('Meditation Bonus', () => {
|
||||
it('should ramp up over time', () => {
|
||||
const bonus1hr = getMeditationBonus(25, {}); // 1 hour of ticks
|
||||
expect(bonus1hr).toBeGreaterThan(1);
|
||||
|
||||
|
||||
const bonus4hr = getMeditationBonus(100, {}); // 4 hours
|
||||
expect(bonus4hr).toBeGreaterThan(bonus1hr);
|
||||
});
|
||||
@@ -177,4 +177,4 @@ describe('Incursion Strength', () => {
|
||||
});
|
||||
});
|
||||
|
||||
console.log('✅ Meditation, insight, and incursion tests defined.');
|
||||
console.log('✅ Meditation, insight, and incursion tests defined.');
|
||||
@@ -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 {
|
||||
@@ -12,7 +13,7 @@ function createMockState(overrides: Partial<GameState> = {}): GameState {
|
||||
Object.keys(ELEMENTS).forEach((k) => {
|
||||
elements[k] = { current: 0, max: 10, unlocked: ['fire', 'water', 'air', 'earth'].includes(k) };
|
||||
});
|
||||
|
||||
|
||||
return {
|
||||
day: 1,
|
||||
hour: 0,
|
||||
@@ -104,7 +105,7 @@ describe('Mana Calculation Functions', () => {
|
||||
const state = createMockState({ prestigeUpgrades: { manaWell: 3 } });
|
||||
expect(computeMaxMana(state)).toBe(100 + 3 * 500);
|
||||
});
|
||||
|
||||
|
||||
it('should stack manaWell skill and prestige', () => {
|
||||
const state = createMockState({
|
||||
skills: { manaWell: 5 },
|
||||
@@ -118,7 +119,7 @@ describe('Mana Calculation Functions', () => {
|
||||
// Base regen is 2, but computeRegen now includes attunement regen
|
||||
// Enchanter (active, level 1) adds rawManaRegen * 1.5^0 = rawManaRegen
|
||||
// Default enchanter rawManaRegen is 0.5, so base with enchanter = 2 + 0.5 = 2.5
|
||||
|
||||
|
||||
it('should return base regen with no upgrades (includes attunement regen)', () => {
|
||||
const state = createMockState();
|
||||
// Base 2 + enchanter regen (0.5 * 1 = 0.5) = 2.5
|
||||
@@ -184,4 +185,4 @@ describe('Mana Calculation Functions', () => {
|
||||
});
|
||||
});
|
||||
|
||||
console.log('✅ Mana calculation tests defined (from stores/__tests__/stores.test.ts).');
|
||||
console.log('✅ Mana calculation tests defined (from stores/__tests__/stores.test.ts).');
|
||||
Reference in New Issue
Block a user