Skip to content

Commit

Permalink
test: improve test coverage for os package
Browse files Browse the repository at this point in the history
PR-URL: #44959
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
  • Loading branch information
juanarbol authored and danielleadams committed Dec 30, 2022
1 parent be4f32c commit 3f617ac
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions test/parallel/test-os-process-priority.js
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,14 @@ for (let i = PRIORITY_HIGHEST; i <= PRIORITY_LOW; i++) {
checkPriority(process.pid, i);
}

{
assert.throws(() => { os.getPriority(-1); }, {
code: 'ERR_SYSTEM_ERROR',
message: /A system error occurred: uv_os_getpriority returned /,
name: 'SystemError'
});
}


function checkPriority(pid, expected) {
const priority = os.getPriority(pid);
Expand Down

0 comments on commit 3f617ac

Please sign in to comment.