From fac591b2050ce95610d26919ddbe4bf9b9bf57d4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Juan=20Jos=C3=A9=20Arboleda?= Date: Tue, 11 Oct 2022 02:42:01 -0500 Subject: [PATCH] test: improve test coverage for `os` package --- 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);