MCPcopy Index your code
hub / github.com/nodejs/node / check

Function check

test/parallel/test-worker-cpu-usage.js:17–41  ·  view source on GitHub ↗
(worker)

Source from the content-addressed store, hash-verified

15}
16
17function check(worker) {
18 [
19 NaN,
20 undefined,
21 null,
22 ].forEach((value) => {
23 worker.cpuUsage(value);
24 });
25 [
26 -1,
27 1.1,
28 {},
29 [],
30 function() {},
31 Symbol(),
32 true,
33 Infinity,
34 { user: -1, system: 1 },
35 { user: 1, system: -1 },
36 ].forEach((value) => {
37 assert.throws(() => {
38 worker.cpuUsage(value);
39 }, /ERR_OUT_OF_RANGE|ERR_INVALID_ARG_TYPE/i);
40 });
41}
42
43const worker = new Worker(`
44 const { parentPort } = require('worker_threads');

Callers 1

Calls 3

forEachMethod · 0.65
cpuUsageMethod · 0.65
SymbolFunction · 0.50

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…