+ it('Verify getWorkerType() behavior', () => {
+ expect(
+ getWorkerType(new Worker('./tests/worker-files/thread/testWorker.js'))
+ ).toBe(WorkerTypes.thread)
+ expect(getWorkerType(cluster.fork())).toBe(WorkerTypes.cluster)
+ })
+
+ it('Verify getWorkerId() behavior', () => {
+ const threadWorker = new Worker('./tests/worker-files/thread/testWorker.js')
+ const clusterWorker = cluster.fork()
+ expect(getWorkerId(threadWorker)).toBe(threadWorker.threadId)
+ expect(getWorkerId(clusterWorker)).toBe(clusterWorker.id)
+ })
+
+ it.skip('Verify sleep() behavior', async () => {