X-Git-Url: https://git.piment-noir.org/?a=blobdiff_plain;f=tests%2Futils.test.mjs;h=25b4e5ae0cfd21cc84e5fb523748e84e44a95e0b;hb=HEAD;hp=b977e102330e52440c618fdadf65b8bef0f51972;hpb=3a5027122ca6401ae1d755843b20f714c61e3240;p=poolifier.git diff --git a/tests/utils.test.mjs b/tests/utils.test.mjs index b977e1023..92bbcbc78 100644 --- a/tests/utils.test.mjs +++ b/tests/utils.test.mjs @@ -1,8 +1,7 @@ +import { expect } from '@std/expect' import { randomInt } from 'node:crypto' import os from 'node:os' -import { expect } from 'expect' - import { KillBehaviors } from '../lib/index.cjs' import { availableParallelism, @@ -37,7 +36,6 @@ 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 @@ -150,7 +148,6 @@ describe('Utils test suite', () => { expect(isAsyncFunction('')).toBe(false) expect(isAsyncFunction([])).toBe(false) expect(isAsyncFunction(new Date())).toBe(false) - expect(isAsyncFunction(/[a-z]/i)).toBe(false) expect(isAsyncFunction(new Error())).toBe(false) expect(isAsyncFunction(new Map())).toBe(false) @@ -183,12 +180,12 @@ describe('Utils test suite', () => { expect(isAsyncFunction(async function () {})).toBe(true) expect(isAsyncFunction(async function named () {})).toBe(true) class TestClass { - testSync () {} - async testAsync () {} - testArrowSync = () => {} - testArrowAsync = async () => {} - static testStaticSync () {} static async testStaticAsync () {} + static testStaticSync () {} + testArrowAsync = async () => {} + testArrowSync = () => {} + async testAsync () {} + testSync () {} } const testClass = new TestClass() expect(isAsyncFunction(testClass.testSync)).toBe(false)