summaryrefslogtreecommitdiff
path: root/packages/cli/src/ui/utils/updateCheck.test.ts
diff options
context:
space:
mode:
authorYuki Okita <[email protected]>2025-07-18 09:44:45 +0900
committerGitHub <[email protected]>2025-07-18 00:44:45 +0000
commit584a50a3422fc543a0f861cd946fa0403acc12f0 (patch)
tree8e514baa322b2c8ed95526c269ddbb8845b6fcb7 /packages/cli/src/ui/utils/updateCheck.test.ts
parentca07b5b0c41defb27d6b156faba356ab900ee092 (diff)
fix(cli): not show update avaialble messages when running gemini-cli locally (#4052)
Diffstat (limited to 'packages/cli/src/ui/utils/updateCheck.test.ts')
-rw-r--r--packages/cli/src/ui/utils/updateCheck.test.ts17
1 files changed, 17 insertions, 0 deletions
diff --git a/packages/cli/src/ui/utils/updateCheck.test.ts b/packages/cli/src/ui/utils/updateCheck.test.ts
index 6d3c8b77..975c320d 100644
--- a/packages/cli/src/ui/utils/updateCheck.test.ts
+++ b/packages/cli/src/ui/utils/updateCheck.test.ts
@@ -20,6 +20,23 @@ vi.mock('update-notifier', () => ({
describe('checkForUpdates', () => {
beforeEach(() => {
vi.resetAllMocks();
+ // Clear DEV environment variable before each test
+ delete process.env.DEV;
+ });
+
+ it('should return null when running from source (DEV=true)', async () => {
+ process.env.DEV = 'true';
+ getPackageJson.mockResolvedValue({
+ name: 'test-package',
+ version: '1.0.0',
+ });
+ updateNotifier.mockReturnValue({
+ update: { current: '1.0.0', latest: '1.1.0' },
+ });
+ const result = await checkForUpdates();
+ expect(result).toBeNull();
+ expect(getPackageJson).not.toHaveBeenCalled();
+ expect(updateNotifier).not.toHaveBeenCalled();
});
it('should return null if package.json is missing', async () => {