test: refine UTs
authorJérôme Benoit <jerome.benoit@piment-noir.org>
Mon, 28 Aug 2023 15:58:57 +0000 (17:58 +0200)
committerJérôme Benoit <jerome.benoit@piment-noir.org>
Mon, 28 Aug 2023 15:58:57 +0000 (17:58 +0200)
Signed-off-by: Jérôme Benoit <jerome.benoit@piment-noir.org>
tests/utils.test.js

index fdb67478c471e38f152b7f87d5d63dc6b775a820..93e9e5c2e9b17f99165beb29e028239c7328dfa9 100644 (file)
@@ -57,6 +57,7 @@ describe('Utils test suite', () => {
   it('Verify availableParallelism() behavior', () => {
     const parallelism = availableParallelism()
     expect(typeof parallelism === 'number').toBe(true)
+    expect(Number.isSafeInteger(parallelism)).toBe(true)
     let expectedParallelism = 1
     try {
       expectedParallelism = os.availableParallelism()
@@ -64,7 +65,6 @@ describe('Utils test suite', () => {
       expectedParallelism = os.cpus().length
     }
     expect(parallelism).toBe(expectedParallelism)
-    expect(Number.isSafeInteger(parallelism)).toBe(true)
   })
 
   it('Verify getWorkerType() behavior', () => {