test(companion): add non-finite waitForIdle validation coverage

This commit is contained in:
William Valentin
2026-02-16 22:20:54 -08:00
parent 9e442920d2
commit a6e9daaaef
2 changed files with 23 additions and 0 deletions
+12
View File
@@ -719,6 +719,12 @@ describe('CompanionRuntimeClient', () => {
expect(() => client.waitForIdle({ pollIntervalMs: 0 })).toThrow(
'pollIntervalMs must be a positive number',
);
expect(() => client.waitForIdle({ pollIntervalMs: Number.NaN })).toThrow(
'pollIntervalMs must be a positive number',
);
expect(() => client.waitForIdle({ pollIntervalMs: Number.POSITIVE_INFINITY })).toThrow(
'pollIntervalMs must be a positive number',
);
});
it('waitForIdle validates timeoutMs option', () => {
@@ -729,6 +735,12 @@ describe('CompanionRuntimeClient', () => {
expect(() => client.waitForIdle({ timeoutMs: 0 })).toThrow(
'timeoutMs must be a positive number',
);
expect(() => client.waitForIdle({ timeoutMs: Number.NaN })).toThrow(
'timeoutMs must be a positive number',
);
expect(() => client.waitForIdle({ timeoutMs: Number.POSITIVE_INFINITY })).toThrow(
'timeoutMs must be a positive number',
);
});
it('waitForIdle resolves after pending event waiters are cleared', async () => {