xref: /third_party/node/test/parallel/test-util-sleep.js
  • Home
  • History
  • Annotate Annotate
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
  • only in /third_party/node/test/parallel/
11cb0ef41Sopenharmony_ci// Flags: --expose-internals
21cb0ef41Sopenharmony_ci'use strict';
31cb0ef41Sopenharmony_cirequire('../common');
41cb0ef41Sopenharmony_ciconst assert = require('assert');
51cb0ef41Sopenharmony_ciconst { sleep } = require('internal/util');
61cb0ef41Sopenharmony_ci
71cb0ef41Sopenharmony_ci[undefined, null, '', {}, true, false].forEach((value) => {
81cb0ef41Sopenharmony_ci  assert.throws(
91cb0ef41Sopenharmony_ci    () => { sleep(value); },
101cb0ef41Sopenharmony_ci    /The "msec" argument must be of type number/
111cb0ef41Sopenharmony_ci  );
121cb0ef41Sopenharmony_ci});
131cb0ef41Sopenharmony_ci
141cb0ef41Sopenharmony_ci[-1, 3.14, NaN, 4294967296].forEach((value) => {
151cb0ef41Sopenharmony_ci  assert.throws(
161cb0ef41Sopenharmony_ci    () => { sleep(value); },
171cb0ef41Sopenharmony_ci    /The value of "msec" is out of range/
181cb0ef41Sopenharmony_ci  );
191cb0ef41Sopenharmony_ci});
20

Indexes created Thu Nov 07 10:32:03 CST 2024