• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1'use strict';
2require('../common');
3const assert = require('assert');
4const test = require('node:test');
5
6[Symbol(), {}, [], () => {}, 1n, true, '1'].forEach((timeout) => {
7  assert.throws(() => test({ timeout }), { code: 'ERR_INVALID_ARG_TYPE' });
8});
9[-1, -Infinity, NaN, 2 ** 33, Number.MAX_SAFE_INTEGER].forEach((timeout) => {
10  assert.throws(() => test({ timeout }), { code: 'ERR_OUT_OF_RANGE' });
11});
12[null, undefined, Infinity, 0, 1, 1.1].forEach((timeout) => {
13  // Valid values should not throw.
14  test({ timeout });
15});
16
17[Symbol(), {}, [], () => {}, 1n, '1'].forEach((concurrency) => {
18  assert.throws(() => test({ concurrency }), { code: 'ERR_INVALID_ARG_TYPE' });
19});
20[-1, 0, 1.1, -Infinity, NaN, 2 ** 33, Number.MAX_SAFE_INTEGER].forEach((concurrency) => {
21  assert.throws(() => test({ concurrency }), { code: 'ERR_OUT_OF_RANGE' });
22});
23[null, undefined, 1, 2 ** 31, true, false].forEach((concurrency) => {
24  // Valid values should not throw.
25  test({ concurrency });
26});
27