diff --git a/test/parallel/test-os-process-priority.js b/test/parallel/test-os-process-priority.js index c6fdbff9e554d9..ed8cb3475c33ef 100644 --- a/test/parallel/test-os-process-priority.js +++ b/test/parallel/test-os-process-priority.js @@ -109,6 +109,16 @@ for (let i = PRIORITY_HIGHEST; i <= PRIORITY_LOW; i++) { checkPriority(process.pid, i); } +{ + // From libuv docs + // "The priority value range is between -20 (high priority) and 19 (low priority)" + assert.throws(() => { os.getPriority(-21); }, { + code: 'ERR_SYSTEM_ERROR', + message: 'A system error occurred: uv_os_getpriority returned ESRCH (no such process)', + name: 'SystemError' + }); +} + function checkPriority(pid, expected) { const priority = os.getPriority(pid);