How to use the package-json.mockImplementation function in package-json

To help you get started, we’ve selected a few package-json 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 polkadot-js / client / packages / client / src / clientId.spec.js View on Github external
it('queries the registry, showing newer', () => {
      npmJson.mockImplementation(() => {
        return Promise.resolve({ version: '0.0.0' });
      });

      return clientId.getNpmStatus().then((version) => {
        expect(version).toEqual('newer, 0.0.0 published');
      });
    });
  });

package-json

Get metadata of a package from the npm registry

MIT
Latest version published 5 months ago

Package Health Score

78 / 100
Full package analysis