From cc09876dac99f917f321f5c15e65c237dee7a92c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Juan=20Jos=C3=A9?= Date: Sat, 15 Oct 2022 15:47:39 -0500 Subject: [PATCH] test: improve test coverage for `os` package PR-URL: https://github.com/nodejs/node/pull/44959 Reviewed-By: Luigi Pinca Reviewed-By: Colin Ihrig Reviewed-By: James M Snell --- test/parallel/test-os-process-priority.js | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/test/parallel/test-os-process-priority.js b/test/parallel/test-os-process-priority.js index c6fdbff9e554d9..2edabf53dff333 100644 --- a/test/parallel/test-os-process-priority.js +++ b/test/parallel/test-os-process-priority.js @@ -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);