test: cleanup sinon import
[poolifier.git] / tests / pools / abstract-pool.test.mjs
index 84212a3f4f81f953fe50a718cac4f5f0edba1cdf..041c62a2b1277c179d689dbe182d6b382fc55cef 100644 (file)
@@ -1,5 +1,7 @@
 import { EventEmitterAsyncResource } from 'node:events'
+import { dirname, join } from 'node:path'
 import { readFileSync } from 'node:fs'
+import { fileURLToPath } from 'node:url'
 import { expect } from 'expect'
 import { restore, stub } from 'sinon'
 import {
@@ -19,7 +21,12 @@ import { waitPoolEvents } from '../test-utils.js'
 import { WorkerNode } from '../../lib/pools/worker-node.js'
 
 describe('Abstract pool test suite', () => {
-  const version = JSON.parse(readFileSync('./package.json', 'utf8')).version
+  const version = JSON.parse(
+    readFileSync(
+      join(dirname(fileURLToPath(import.meta.url)), '../..', 'package.json'),
+      'utf8'
+    )
+  ).version
   const numberOfWorkers = 2
   class StubPoolWithIsMain extends FixedThreadPool {
     isMain () {
@@ -290,7 +297,7 @@ describe('Abstract pool test suite', () => {
     await pool.destroy()
   })
 
-  it('Verify that pool options are validated', async () => {
+  it('Verify that pool options are validated', () => {
     expect(
       () =>
         new FixedThreadPool(