How to use the load-json-file.mockReturnValueOnce 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 package.json content', async () => {
      loadJsonFile.mockReturnValueOnce(Promise.resolve(packageJsonContent))

      const result = await getPackageJson()

      expect(result).toEqual(packageJsonContent)
    })

load-json-file

Read and parse a JSON file

MIT
Latest version published 3 years ago

Package Health Score

73 / 100
Full package analysis