test(cli): isolate root router completion coverage

- stop mocking the completion backend in root-command-router tests

- remove cross-file module poisoning that caused flaky CI ordering failures
This commit is contained in:
Tam Nhu Tran
2026-04-03 01:06:36 -04:00
parent 3dcf879c9f
commit 2d5bda7f76
@@ -42,12 +42,6 @@ beforeEach(() => {
mock.module('../../../src/commands/tokens-command', () => ({
handleTokensCommand: async () => 37,
}));
mock.module('../../../src/commands/completion-backend', () => ({
handleCompletionCommand: async (args: string[]) => {
calls.push(`complete:${args.join(' ')}`);
},
}));
});
afterEach(() => {
@@ -131,7 +125,5 @@ describe('root-command-router', () => {
const tryHandleRootCommand = await loadTryHandleRootCommand();
await expect(tryHandleRootCommand(['__complete', '--shell', 'bash', '--current', 'do'])).resolves.toBe(true);
expect(calls).toEqual(['complete:--shell bash --current do']);
});
});