perf(test): optimize test suite speed and stability

This commit is contained in:
mkorwel
2026-04-14 23:35:02 -07:00
parent a0a3e0c666
commit 78c8ace77f
24 changed files with 85653 additions and 117 deletions
+3 -3
View File
@@ -1085,12 +1085,12 @@ describe('runNonInteractive', () => {
(async function* () {
yield events[0];
await new Promise((resolve, reject) => {
const timeout = setTimeout(resolve, 1000);
const timeout = setTimeout(resolve, 2000);
signal.addEventListener('abort', () => {
clearTimeout(timeout);
setTimeout(() => {
reject(new Error('Aborted')); // This will be caught by nonInteractiveCli and passed to handleError
}, 300);
}, 20);
});
});
})(),
@@ -1104,7 +1104,7 @@ describe('runNonInteractive', () => {
});
// Wait a bit for setup to complete and listeners to be registered
await new Promise((resolve) => setTimeout(resolve, 100));
await new Promise((resolve) => setTimeout(resolve, 50));
// Find the keypress handler registered by runNonInteractive
const keypressCall = stdinOnSpy.mock.calls.find(