Skip to content

Commit 6c3c9e9

Browse files
committed
test: improve test coverage for os package
1 parent 6831e2f commit 6c3c9e9

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

test/parallel/test-os-process-priority.js

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -109,6 +109,16 @@ for (let i = PRIORITY_HIGHEST; i <= PRIORITY_LOW; i++) {
109109
checkPriority(process.pid, i);
110110
}
111111

112+
{
113+
// From libuv docs
114+
// "The priority value range is between -20 (high priority) and 19 (low priority)"
115+
assert.throws(() => { os.getPriority(-21); }, {
116+
code: 'ERR_SYSTEM_ERROR',
117+
message: 'A system error occurred: uv_os_getpriority returned ESRCH (no such process)',
118+
name: 'SystemError'
119+
});
120+
}
121+
112122

113123
function checkPriority(pid, expected) {
114124
const priority = os.getPriority(pid);

0 commit comments

Comments
 (0)