status: false,
error: new TypeError('name parameter is an empty string')
})
- expect(worker.taskFunctions.get(DEFAULT_TASK_NAME)).toBeInstanceOf(Object)
- expect(worker.taskFunctions.get('fn1')).toBeInstanceOf(Object)
- expect(worker.taskFunctions.get('fn2')).toBeInstanceOf(Object)
+ expect(worker.taskFunctions.get(DEFAULT_TASK_NAME)).toStrictEqual({
+ taskFunction: expect.any(Function)
+ })
+ expect(worker.taskFunctions.get('fn1')).toStrictEqual({
+ taskFunction: expect.any(Function)
+ })
+ expect(worker.taskFunctions.get('fn2')).toStrictEqual({
+ taskFunction: expect.any(Function)
+ })
expect(worker.taskFunctions.size).toBe(3)
expect(worker.taskFunctions.get(DEFAULT_TASK_NAME)).toStrictEqual(
worker.taskFunctions.get('fn1')
)
})
worker.removeTaskFunction('fn2')
- expect(worker.taskFunctions.get(DEFAULT_TASK_NAME)).toBeInstanceOf(Object)
- expect(worker.taskFunctions.get('fn1')).toBeInstanceOf(Object)
+ expect(worker.taskFunctions.get(DEFAULT_TASK_NAME)).toStrictEqual({
+ taskFunction: expect.any(Function)
+ })
+ expect(worker.taskFunctions.get('fn1')).toStrictEqual({
+ taskFunction: expect.any(Function)
+ })
expect(worker.taskFunctions.get('fn2')).toBeUndefined()
expect(worker.taskFunctions.size).toBe(2)
expect(worker.getMainWorker.calledTwice).toBe(true)