Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
describe('chunked tasks', () => {
afterEach(() => {
execa.mockClear()
pMap.mockClear()
})
pMap.mockResolvedValue([
{
stdout: 'a-ok',
stderr: '',
code: 0,
failed: false,
cmd: 'mock cmd'
}
])
it('should invoke execa in mapper function', async () => {
expect.assertions(3)
const taskFn = resolveTaskFn({ ...defaultOpts })
await taskFn()
const [[[chunk], mapper]] = pMap.mock.calls
expect(pMap).toHaveBeenCalledWith([['test.js']], mapper, { concurrency: 1 })