How to use the load-json-file.mockImplementationOnce function in load-json-file

To help you get started, we’ve selected a few load-json-file 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 kefranabg / readme-md-generator / src / utils.spec.js View on Github external
it('should return undefined', async () => {
      loadJsonFile.mockImplementationOnce(() => {
        throw new Error('ERROR')
      })

      const result = await getPackageJson()

      expect(result).toBeUndefined()
    })
  })

load-json-file

Read and parse a JSON file

MIT
Latest version published 3 years ago

Package Health Score

73 / 100
Full package analysis