test: improve test coverage for os package

PR-URL: https://github.com/nodejs/node/pull/44959
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
This commit is contained in:
Juan José 2022-10-15 15:47:39 -05:00 committed by GitHub
parent e57713e337
commit 5e30559318
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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);