chore: use neostandard exported plugins when possible
[poolifier.git] / tests / utils.test.mjs
index bf6d3f08a6480be8e1470f242321300e184e66a8..25b4e5ae0cfd21cc84e5fb523748e84e44a95e0b 100644 (file)
@@ -19,7 +19,7 @@ import {
   // once,
   round,
   secureRandom,
-  sleep
+  sleep,
 } from '../lib/utils.cjs'
 
 describe('Utils test suite', () => {
@@ -37,6 +37,7 @@ describe('Utils test suite', () => {
     expect(Number.isSafeInteger(parallelism)).toBe(true)
     let expectedParallelism = 1
     try {
+      // eslint-disable-next-line n/no-unsupported-features/node-builtins
       expectedParallelism = os.availableParallelism()
     } catch {
       expectedParallelism = os.cpus().length
@@ -149,8 +150,7 @@ describe('Utils test suite', () => {
     expect(isAsyncFunction('')).toBe(false)
     expect(isAsyncFunction([])).toBe(false)
     expect(isAsyncFunction(new Date())).toBe(false)
-    // eslint-disable-next-line prefer-regex-literals
-    expect(isAsyncFunction(new RegExp('[a-z]', 'i'))).toBe(false)
+    expect(isAsyncFunction(/[a-z]/i)).toBe(false)
     expect(isAsyncFunction(new Error())).toBe(false)
     expect(isAsyncFunction(new Map())).toBe(false)
     expect(isAsyncFunction(new Set())).toBe(false)
@@ -206,14 +206,14 @@ describe('Utils test suite', () => {
   })
 
   it('Verify min() behavior', () => {
-    expect(min()).toBe(Infinity)
+    expect(min()).toBe(Number.POSITIVE_INFINITY)
     expect(min(1, 2)).toBe(1)
     expect(min(2, 1)).toBe(1)
     expect(min(1, 1)).toBe(1)
   })
 
   it('Verify max() behavior', () => {
-    expect(max()).toBe(-Infinity)
+    expect(max()).toBe(Number.NEGATIVE_INFINITY)
     expect(max(1, 2)).toBe(2)
     expect(max(2, 1)).toBe(2)
     expect(max(1, 1)).toBe(1)