Dashboardclidelta-upgrade CLI_VERSION mocks

delta-upgrade CLI_VERSION mocks

Category: gotcha
Confidence: 1.00
ID: 01a0867e-7e00-78cc-9d6c-29f1d8f1dcdf
Project ID: c760f4f9-42b0-4ce0-b36d-6b8c38d770b2
Cross-project: No
Recalled in other projects: 0
Source session: 1W0vc18fUQ99w7CwT
Created: 2026-09-09 14:07:11
Updated: 2026-09-09 14:07:11

Content

Trap: statically mocking CLI_VERSION inside delta-upgrade.test.ts looks simpler, but it reverses that file’s dev-build assumptions and contaminates tests through the module graph. Fix: keep stable-version orchestration tests in a sibling isolated file, or use vi.resetModules() plus vi.doMock() before dynamic import and always doUnmock()/reset afterward.

Move to: