How to use the p-map.mockResolvedValueOnce function in p-map

To help you get started, we’ve selected a few p-map examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github okonet / lint-staged / test / resolveTaskFn-chunked.spec.js View on Github external
it('should throw error for failed linters', async () => {
      expect.assertions(1)
      pMap.mockResolvedValueOnce([
        {
          stdout: 'Mock error',
          stderr: '',
          code: 0,
          failed: true,
          cmd: 'mock cmd'
        }
      ])

      const taskFn = resolveTaskFn({
        ...defaultOpts,
        linter: 'mock-fail-linter'
      })
      try {
        await taskFn()
      } catch (err) {

p-map

Map over promises concurrently

MIT
Latest version published 8 months ago

Package Health Score

78 / 100
Full package analysis