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 Jan 3, 2023
1 parent 33c78e2 commit 5544c55
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 5544c55

Please sign in to comment.