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

Function validateResult

test/parallel/test-process-threadCpuUsage-main-thread.js:7–15  ·  view source on GitHub ↗
(result)

Source from the content-addressed store, hash-verified

5const assert = require('assert');
6
7function validateResult(result) {
8 assert.notStrictEqual(result, null);
9
10 assert.ok(Number.isFinite(result.user));
11 assert.ok(Number.isFinite(result.system));
12
13 assert.ok(result.user >= 0);
14 assert.ok(result.system >= 0);
15}
16
17// Test that process.threadCpuUsage() works on the main thread
18// The if check and the else branch should be removed once SmartOS support is fixed in

Calls 1

okMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…