+ )
+ const emptyPool = new FixedThreadPool(
+ numberOfThreads,
+ './tests/worker-files/thread/emptyWorker.js',
+ { exitHandler: () => console.log('empty pool worker exited') }
+ )
+ const echoPool = new FixedThreadPool(
+ numberOfThreads,
+ './tests/worker-files/thread/echoWorker.js'
+ )
+ const errorPool = new FixedThreadPool(
+ numberOfThreads,
+ './tests/worker-files/thread/errorWorker.js',
+ {
+ errorHandler: e => console.error(e)
+ }
+ )
+ const asyncErrorPool = new FixedThreadPool(
+ numberOfThreads,
+ './tests/worker-files/thread/asyncErrorWorker.js',
+ {
+ errorHandler: e => console.error(e)
+ }
+ )
+ const asyncPool = new FixedThreadPool(
+ numberOfThreads,
+ './tests/worker-files/thread/asyncWorker.js'
+ )
+
+ after('Destroy all pools', async () => {
+ // We need to clean up the resources after our test
+ await echoPool.destroy()
+ await asyncPool.destroy()
+ await errorPool.destroy()
+ await asyncErrorPool.destroy()
+ await emptyPool.destroy()