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 <[email protected]>
Reviewed-By: Colin Ihrig <[email protected]>
Reviewed-By: James M Snell <[email protected]>
  • Loading branch information
juanarbol authored and RafaelGSS committed Nov 10, 2022
1 parent 5fce8e3 commit 3519d74
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 3519d74

Please sign in to comment.