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 committed Oct 15, 2022
1 parent e57713e commit 5e30559
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions test/parallel/test-os-process-priority.js
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 5e30559

Please sign in to comment.