How to use the path-exists.mockImplementation function in path-exists

To help you get started, we’ve selected a few path-exists 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 lerna / lerna / test / FileSystemUtilities.js View on Github external
it("calls rimraf CLI with arguments", done => {
      pathExists.mockImplementation(() => Promise.resolve(true));
      FileSystemUtilities.rimraf("rimraf/test", () => {
        try {
          expect(ChildProcessUtilities.spawn).lastCalledWith(
            process.execPath,
            [require.resolve("rimraf/bin"), "--no-glob", path.normalize("rimraf/test/")],
            {},
            expect.any(Function)
          );
          done();
        } catch (ex) {
          done.fail(ex);
        }
      });
    });

path-exists

Check if a path exists

MIT
Latest version published 3 years ago

Package Health Score

70 / 100
Full package analysis