1 const expect
= require('expect')
2 const { generateID
, randomWorker
} = require('../lib/util')
4 describe('Utility Tests ', () => {
5 it('Generate an id', () => {
6 const res
= generateID()
7 expect(res
).toBeTruthy()
8 expect(typeof res
).toBe('string')
11 it('Choose a random worker', () => {
12 const input
= new Map()
16 const worker
= randomWorker(input
)
17 expect(worker
).toBeTruthy()
18 expect(Array
.from(input
.keys()).includes(worker
)).toBeTruthy()