test: improve availableParallelism() test
authorJérôme Benoit <jerome.benoit@sap.com>
Sat, 22 Jul 2023 02:41:16 +0000 (04:41 +0200)
committerJérôme Benoit <jerome.benoit@sap.com>
Sat, 22 Jul 2023 02:41:16 +0000 (04:41 +0200)
Signed-off-by: Jérôme Benoit <jerome.benoit@sap.com>
tests/utils.test.js

index 4053a146fea038d75bd699a57a10a8c83b1e6fe4..f5a5366de86bbd212f456d5a142ec9d9dd1bd5aa 100644 (file)
@@ -14,6 +14,8 @@ const { KillBehaviors } = require('../lib/worker/worker-options')
 describe('Utils test suite', () => {
   it('Verify availableParallelism() behavior', () => {
     expect(typeof availableParallelism() === 'number').toBe(true)
+    expect(availableParallelism()).toBeGreaterThan(0)
+    expect(Number.isSafeInteger(availableParallelism())).toBe(true)
   })
 
   it('Verify median() computation', () => {