class StubWorkerWithMainWorker extends ThreadWorker {
constructor (fn, opts) {
super(fn, opts)
- this.mainWorker = undefined
+ delete this.mainWorker
}
}
expect(killHandlerStub.calledOnce).toBe(true)
})
- it('Verify that handleError() method works properly', () => {
+ it('Verify that handleError() method is working properly', () => {
const error = new Error('Error as an error')
const worker = new ClusterWorker(() => {})
expect(worker.handleError(error)).not.toBeInstanceOf(Error)
).toThrowError('Main worker not set')
})
- it('Verify that hasTaskFunction() works', () => {
+ it('Verify that hasTaskFunction() is working', () => {
const fn1 = () => {
return 1
}
expect(worker.hasTaskFunction('fn3')).toStrictEqual({ status: false })
})
- it('Verify that addTaskFunction() works', () => {
+ it('Verify that addTaskFunction() is working', () => {
const fn1 = () => {
return 1
}
)
})
- it('Verify that removeTaskFunction() works', () => {
+ it('Verify that removeTaskFunction() is working', () => {
const fn1 = () => {
return 1
}
expect(worker.getMainWorker().send.calledOnce).toBe(true)
})
- it('Verify that listTaskFunctionNames() works', () => {
+ it('Verify that listTaskFunctionNames() is working', () => {
const fn1 = () => {
return 1
}
])
})
- it('Verify that setDefaultTaskFunction() works', () => {
+ it('Verify that setDefaultTaskFunction() is working', () => {
const fn1 = () => {
return 1
}