79157435

Date: 2024-11-05 01:34:34
Score: 1
Natty:
Report link

I solve the problem by modify the test snippet like this:

test('It should have status=1 if the process is being executed', async () => {
const array = [[1, 2, 3], [4, 5, 6], [7, 8, 9], null]
const producer = createProducer(array)
const fn = backgroundProcess(producer, defaultConsumer())
fn() //I executed the fn() before the await

await sleep(MAX_MS)
const result = fn()
expect(result.status).toBe(STATUSES.Running) //The problem is the STATUSES is still 0 and must be 1

})

Reasons:
  • Has code block (-0.5):
  • Self-answer (0.5):
  • Low reputation (1):
Posted by: Manuel Esteban Morales Zuarez