})
it('Verify that taskFunctions parameter with unique function is taken', () => {
- const worker = new ThreadWorker(EMPTY_FUNCTION)
+ const worker = new ThreadWorker(() => {})
expect(worker.taskFunctions.get(DEFAULT_TASK_NAME)).toStrictEqual({
taskFunction: expect.any(Function)
})
)
expect(
() => new ThreadWorker({ fn1: { taskFunction: fn1, priority: '' } })
- ).toThrow(new TypeError("Invalid priority ''"))
+ ).toThrow(new TypeError("Invalid property 'priority': ''"))
expect(
() => new ThreadWorker({ fn1: { taskFunction: fn1, priority: -21 } })
- ).toThrow(new TypeError('Property priority must be between -20 and 19'))
+ ).toThrow(new TypeError("Property 'priority' must be between -20 and 19"))
expect(
() => new ThreadWorker({ fn1: { taskFunction: fn1, priority: 20 } })
- ).toThrow(new RangeError('Property priority must be between -20 and 19'))
+ ).toThrow(new RangeError("Property 'priority' must be between -20 and 19"))
expect(
() =>
new ThreadWorker({
)
})
- it('Verify that listTaskFunctionNames() is working', () => {
+ it('Verify that listTaskFunctionsProperties() is working', () => {
const fn1 = () => {
return 1
}