1 const { expect
} = require('expect')
2 const { ClusterWorker
} = require('../../lib')
4 describe('Cluster worker test suite', () => {
5 let numberOfMessagesSent
= 0
9 class SpyWorker
extends ClusterWorker
{
15 it('Verify worker invokes the getMainWorker() and send() methods', () => {
16 const worker
= new SpyWorker(() => {})
17 worker
.sendToMainWorker({ ok
: 1 })
18 expect(numberOfMessagesSent
).toBe(1)