1 import { expect } from 'expect'
2 import { ClusterWorker } from '../../lib/index.js'
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)