> cortex-desktop@0.1.0 test
> vitest run src/components/cortex/editor/__tests__/cov-CortexDiffEditor.test.tsx
FAIL src/components/cortex/editor/__tests__/cov-CortexDiffEditor.test.tsx
Error: [vitest] No "getProjectPath" export is defined on the "@/utils/workspace" mock.
? getInitialCwd src/context/SDKContext.tsx:141:12
Project:
Description:
src/components/cortex/editor/__tests__/cov-CortexDiffEditor.test.tsxfails before any tests run because its@/utils/workspacemock omitsgetProjectPath.SDKContextcallsgetProjectPath()during initialization, so the suite crashes at import/setup time with0 testexecuted.npm run testfailing onmainbecause the broken suite aborts the run.Error Message:
[vitest] No "getProjectPath" export is defined on the "@/utils/workspace" mock. Did you forget to return it from "vi.mock"?Debug Logs:
npm.cmd run test -- src/components/cortex/editor/__tests__/cov-CortexDiffEditor.test.tsxSystem Information:
rustcnot on PATH; not required for repro)Screenshots:
getProjectPathmock export.cov-CortexDiffEditor.test.tsx, the realgetProjectPathexport inworkspace.ts, and the call site inSDKContext.tsx.Win+Shift+Sfor screenshots,Win+Alt+Rfor video.Shift+Cmd+4for screenshots,Shift+Cmd+5for video.PrtSc/Shift+PrtScfor screenshots,Ctrl+Alt+Shift+Ror OBS for video.Steps to Reproduce:
git clone https://github.com/CortexLM/cortex-ide.gitcd cortex-idenpm.cmd cinpm.cmd run test -- src/components/cortex/editor/__tests__/cov-CortexDiffEditor.test.tsx@/utils/workspacemodule does not providegetProjectPath.Expected Behavior:
cov-CortexDiffEditorsuite should load and execute its tests without import-time mock errors.Actual Behavior:
0 testexecuted becauseSDKContextreachesgetProjectPath()and the mocked module does not export it.Additional Context:
getProjectPathto the test mock or partially mocking@/utils/workspacewithimportOriginal.src/components/cortex/editor/__tests__/cov-CortexDiffEditor.test.tsx:5src/utils/workspace.ts:20src/context/SDKContext.tsx:141cov-CortexDiffEditor.test.tsx getProjectPath,No getProjectPath export workspace mock, andvitest workspace mock getProjectPathreturned no matches before filing.