diff --git a/frontend/src/__tests__/multi-board-integration.test.ts b/frontend/src/__tests__/multi-board-integration.test.ts index 42e26c1b..e0f433cd 100644 --- a/frontend/src/__tests__/multi-board-integration.test.ts +++ b/frontend/src/__tests__/multi-board-integration.test.ts @@ -49,6 +49,11 @@ vi.mock('../simulation/PinManager', () => ({ this.onPinChange = vi.fn().mockReturnValue(() => {}); this.getListenersCount = vi.fn().mockReturnValue(0); this.resetPinStates = vi.fn(); + // Added by upstream commit d64eebc (Stop semantics): the simulator + // store's stopBoard() invokes hardResetPinStates on the active pin + // manager. The mock has to expose it or test calls explode with + // "is not a function" even though the optional chain looks safe. + this.hardResetPinStates = vi.fn(); }), })); diff --git a/frontend/vitest.config.ts b/frontend/vitest.config.ts index f7c97fba..cc41fdab 100644 --- a/frontend/vitest.config.ts +++ b/frontend/vitest.config.ts @@ -1,4 +1,5 @@ import { defineConfig } from 'vitest/config'; +import path from 'path'; /** * Vitest configuration — split out from `vite.config.ts` (Phase 1d-tests J). @@ -15,8 +16,19 @@ import { defineConfig } from 'vitest/config'; * isolation, state leaks between tests sharing the same worker. * - Coverage excludes the WASM bundle (large binary, irrelevant lcov) * and the test files themselves. + * + * - `resolve.alias` mirrors `vite.config.ts` — vitest's defineConfig + * does NOT auto-inherit from vite.config.ts, so the @velxio alias + * used by overlay tests (e.g. pro/.../snapshot.test.ts importing + * `@velxio/store/useEditorStore`) must be declared here too or + * test files explode with "Cannot find package '@velxio/...'". */ export default defineConfig({ + resolve: { + alias: { + '@velxio': path.resolve(__dirname, 'src'), + }, + }, // Allow vitest to import test files / sources from outside this // project root - specifically `../../pro/frontend/src/pro/...` for // velxio-prod overlay tests. Without this, Vite's fs sandbox blocks