Node.js/Jest

[Node.js] Jest worker encountered 4 child process exceptions, exceeding retry limit

brightlightkim 2022. 4. 7. 07:00
Jest worker encountered 4 child process exceptions, exceeding retry limit

If you see this kind of message in your Console, it means that it has to be done with Async and await. 

 

In my case..

describe('InputSchema when validated', () => {
    it('should be a valid schema', async () => {
      expect(Joi.isSchema(InputSchema)).toBe(true)
      InputSchema.validateAsync(mockValidInput)      
      InputSchema.validateAsync(mockValidInput)
    })
})

I got an error so I debugged it with it.only

it.only can do the jest it with that block only and skip other its to debug easily.

 

Then I found out that I didn't put await in front of the InputSchema.validateAsync(....)

 

describe('InputSchema when validated', () => {
    it('should be a valid schema', async () => {
      expect(Joi.isSchema(InputSchema)).toBe(true)
      await InputSchema.validateAsync(mockRecordingManagerStartValidInput)      
      await InputSchema.validateAsync(mockRecordingManagerStopValidInput)
    })
 })

Then, it worked just fine. 

'Node.js > Jest' 카테고리의 다른 글

[Jest] set, clear and reset mock/spy/stub implementation  (0) 2022.04.16
[Jest] Jest Mock Functions  (0) 2022.04.15
[JEST] describe  (0) 2022.04.02
[JEST] Jest Functions with AWS  (0) 2022.04.02
[Node] Best JavaScript code snippets using joi.date  (0) 2022.04.02