restore()
})
+ it('Verify worker properties value after initialization', () => {
+ const worker = new ClusterWorker(() => {})
+ expect(worker.isMain).toBe(true)
+ expect(worker.mainWorker).toBe(undefined)
+ expect(worker.taskFunctions).toBeInstanceOf(Map)
+ expect(worker.taskFunctions.size).toBe(2)
+ })
+
it('Verify that sync kill handler is called when worker is killed', () => {
const worker = new ClusterWorker(() => {}, {
killHandler: stub().returns()
restore()
})
+ it('Verify worker properties value after initialization', () => {
+ const worker = new ThreadWorker(() => {})
+ expect(worker.isMain).toBe(true)
+ expect(worker.mainWorker).toBe(null)
+ expect(worker.taskFunctions).toBeInstanceOf(Map)
+ expect(worker.taskFunctions.size).toBe(2)
+ })
+
it('Verify that sync kill handler is called when worker is killed', () => {
const worker = new ThreadWorker(() => {}, {
killHandler: stub().returns()