score:2

you can mock it like this:

jest.mock('uniqid', ()=>(i)=> i + 'someuniqid')

or if you use one of the other functions

jest.mock('uniqid', () = > ({
  process: (i) => i + 'someprocess,
  time: (i) => i + ' sometime,
}))

Related Query

More Query from same tag