How to use the shipjs-lib.updateVersion.mock function in shipjs-lib

To help you get started, we’ve selected a few shipjs-lib 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 algolia / shipjs / packages / shipjs / src / step / prepare / __tests__ / updateVersionMonorepo.spec.js View on Github external
},
      dir: '.',
      nextVersion: '1.2.3',
      releaseType: 'patch',
    });
    expect(updateVersion).toHaveBeenCalledTimes(3);
    expect(updateVersion.mock.calls[0]).toMatchInlineSnapshot(`
      Array [
        Object {
          "dir": ".",
          "fileName": "lerna.json",
          "nextVersion": "1.2.3",
        },
      ]
    `);
    expect(updateVersion.mock.calls[1]).toMatchInlineSnapshot(`
      Array [
        Object {
          "dir": "packages/a",
          "nextVersion": "1.2.3",
        },
      ]
    `);
    expect(updateVersion.mock.calls[2]).toMatchInlineSnapshot(`
      Array [
        Object {
          "dir": "packages/b",
          "nextVersion": "1.2.3",
        },
      ]
    `);
    expect(versionUpdated).toHaveBeenCalledTimes(1);
github algolia / shipjs / packages / shipjs / src / step / prepare / __tests__ / updateVersionMonorepo.spec.js View on Github external
]);
    const versionUpdated = jest.fn();
    updateVersionMonorepo({
      config: {
        versionUpdated,
        monorepo: {
          packagesToBump: ['packages/*'],
          mainVersionFile: 'lerna.json',
        },
      },
      dir: '.',
      nextVersion: '1.2.3',
      releaseType: 'patch',
    });
    expect(updateVersion).toHaveBeenCalledTimes(3);
    expect(updateVersion.mock.calls[0]).toMatchInlineSnapshot(`
      Array [
        Object {
          "dir": ".",
          "fileName": "lerna.json",
          "nextVersion": "1.2.3",
        },
      ]
    `);
    expect(updateVersion.mock.calls[1]).toMatchInlineSnapshot(`
      Array [
        Object {
          "dir": "packages/a",
          "nextVersion": "1.2.3",
        },
      ]
    `);