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 {
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 () {
await pool.destroy()
})
- it('Verify that pool options are validated', async () => {
+ it('Verify that pool options are validated', () => {
expect(
() =>
new FixedThreadPool(