const { expect } = require('expect')
-const { DynamicThreadPool, PoolEvents } = require('../../../lib/index')
+const { DynamicThreadPool, PoolEvents } = require('../../../lib')
const { WorkerFunctions } = require('../../test-types')
const TestUtils = require('../../test-utils')
let result = await pool.execute({
function: WorkerFunctions.fibonacci
})
- expect(result).toBe(false)
+ expect(result).toBe(121393)
result = await pool.execute({
function: WorkerFunctions.factorial
})
- expect(result).toBe(false)
+ expect(result).toBe(9.33262154439441e157)
})
it('Verify that new workers are created when required, max size is not exceeded and that after a while new workers will die', async () => {
it('Validation of inputs test', () => {
expect(() => new DynamicThreadPool(min)).toThrowError(
- new Error('Please specify a file with a worker implementation')
+ 'Please specify a file with a worker implementation'
)
})