qwen-code/packages/cli/src/core
Shaojin Wen d22b7e61ee
test: add tests for confirmation-bus, prompt-registry, and cli/core modules (#2272)
* test: add tests for confirmation-bus, prompt-registry, and cli/core modules

Add 42 new tests covering previously untested core modules:
- MessageBus: publish, subscribe/unsubscribe, request-response pattern (13 tests)
- PromptRegistry: register, dedup, query by server, clear, remove (11 tests)
- performInitialAuth: success, failure, no authType cases (3 tests)
- validateTheme: found, not found, no config cases (4 tests)
- initializeApp: i18n, auth, theme, IDE mode, auth dialog logic (11 tests)

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* fix: improve test quality - copyright headers, env safety, cleanup

- Fix copyright headers from Google LLC to Qwen Code in all 5 test files
- Use vi.stubEnv() instead of manual process.env mutation in initializer test
- Add removeAllListeners() cleanup in message-bus debug test
- Add void prefix to un-awaited publish() calls in message-bus test
- Verify invoke reference preserved after prompt rename in prompt-registry test

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* test(message-bus): add AbortSignal coverage for request()

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
2026-04-09 13:54:59 +08:00
..
auth.test.ts test: add tests for confirmation-bus, prompt-registry, and cli/core modules (#2272) 2026-04-09 13:54:59 +08:00
auth.ts refactor(auth): save authType after successfully authenticated (#1036) 2025-11-19 11:21:46 +08:00
initializer.test.ts test: add tests for confirmation-bus, prompt-registry, and cli/core modules (#2272) 2026-04-09 13:54:59 +08:00
initializer.ts fix(cli): preserve selected auth type on startup auth failure 2026-03-04 16:13:24 +08:00
theme.test.ts test: add tests for confirmation-bus, prompt-registry, and cli/core modules (#2272) 2026-04-09 13:54:59 +08:00
theme.ts feat(i18n): Add Internationalization Support for UI and LLM Output (#1058) 2025-11-21 15:44:37 +08:00