+import cluster from 'node:cluster'
+
import { expect } from 'expect'
import { FixedClusterPool, PoolEvents } from '../../../lib/index.cjs'
let pool = new FixedClusterPool(numberOfWorkers, workerFilePath)
expect(pool.opts.env).toBeUndefined()
expect(pool.opts.settings).toBeUndefined()
+ expect(cluster.settings).toMatchObject({
+ exec: workerFilePath,
+ silent: false
+ })
await pool.destroy()
pool = new FixedClusterPool(numberOfWorkers, workerFilePath, {
env: { TEST: 'test' },
args: ['--use', 'http'],
silent: true
})
- expect({ ...pool.opts.settings, exec: workerFilePath }).toStrictEqual({
+ expect(cluster.settings).toMatchObject({
args: ['--use', 'http'],
silent: true,
exec: workerFilePath