From 5d6db0cd56ea5eca255c4234d8908b6b6aee0d0d Mon Sep 17 00:00:00 2001 From: Huanqi Cao Date: Tue, 21 Jul 2026 13:08:34 +0800 Subject: [PATCH] fix: stub DSH_HOME in 'labels the default DSH home' test The test 'labels the default DSH home as ~/.dsh when HOME points at the configured default' mocks node:os to return a temporary home directory and expects discoverBaselineInstructionFiles to fall back to the default ~/.dsh path. However, when DSH_HOME is externally set (e.g. in the DSH agent environment), resolveDshHome(undefined) reads that external value instead of falling back to defaultDshHome(), causing the test to look for AGENTS.md in the wrong directory and return an empty result. Stub DSH_HOME to undefined so the test controls the full resolution path. --- .../context/workspace-context/tests/workspace-context.spec.ts | 2 ++ 1 file changed, 2 insertions(+) diff --git a/packages/context/workspace-context/tests/workspace-context.spec.ts b/packages/context/workspace-context/tests/workspace-context.spec.ts index 8b0320bcfc..68056e2532 100644 --- a/packages/context/workspace-context/tests/workspace-context.spec.ts +++ b/packages/context/workspace-context/tests/workspace-context.spec.ts @@ -520,6 +520,7 @@ describe('workspace context instruction discovery', () => { vi.resetModules() vi.doMock('node:os', () => ({ homedir: () => home })) + vi.stubEnv('DSH_HOME', undefined) const isolated = await import('@deepseek-ai/dsh-workspace-context') const files = await isolated.discoverBaselineInstructionFiles({ cwd: root }) @@ -527,6 +528,7 @@ describe('workspace context instruction discovery', () => { } finally { vi.doUnmock('node:os') vi.resetModules() + vi.unstubAllEnvs() await rm(root, { recursive: true, force: true }) await rm(home, { recursive: true, force: true }) }