From fb389f39f1b43ab46dfcb1d0fdba64cc92411d50 Mon Sep 17 00:00:00 2001 From: jackwener Date: Sat, 28 Mar 2026 23:37:13 +0800 Subject: [PATCH] fix(tests): update E2E exit code assertions for usage errors MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Argument/usage errors now correctly exit with code 2 (EX_USAGE) since the exit-codes feature landed. Update the two affected E2E assertions: - unknown command → 2 (usage error, not generic failure) - plugin update without args → 2 (ArgumentError) --- tests/e2e/management.test.ts | 2 +- tests/e2e/plugin-management.test.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/e2e/management.test.ts b/tests/e2e/management.test.ts index 3e3ab19f..8a633340 100644 --- a/tests/e2e/management.test.ts +++ b/tests/e2e/management.test.ts @@ -101,6 +101,6 @@ describe('management commands E2E', () => { // ── unknown command ── it('unknown command shows error', async () => { const { stderr, code } = await runCli(['nonexistent-command-xyz']); - expect(code).toBe(1); + expect(code).toBe(2); }); }); diff --git a/tests/e2e/plugin-management.test.ts b/tests/e2e/plugin-management.test.ts index 4702feb9..177d41e2 100644 --- a/tests/e2e/plugin-management.test.ts +++ b/tests/e2e/plugin-management.test.ts @@ -134,7 +134,7 @@ describe('plugin management E2E', () => { it('plugin update without name or --all shows error', async () => { const { stderr, code } = await runPluginCli(['plugin', 'update']); - expect(code).toBe(1); + expect(code).toBe(2); expect(stderr).toContain('specify a plugin name'); }); });