add NaN test

This commit is contained in:
Kiko Beats 2021-10-23 11:59:33 +02:00
parent 486834572b
commit ca733c36c4
1 changed files with 4 additions and 0 deletions

View File

@ -20,6 +20,10 @@ test('throws when milliseconds is negative number', async t => {
await t.throwsAsync(pTimeout(delay(50), -1), {instanceOf: TypeError});
});
test('throws when milliseconds is NaN', async t => {
await t.throwsAsync(pTimeout(delay(50), NaN), {instanceOf: TypeError});
});
test('handles milliseconds being `Infinity`', async t => {
t.is(
await pTimeout(delay(50, {value: fixture}), Number.POSITIVE_INFINITY),