How to use the shipjs-lib.expandPackageList.mockImplementationOnce 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 / release / __tests__ / runPublish.spec.js View on Github external
it('works with monorepo', () => {
    const output = [];
    mockPrint(print, output);
    expandPackageList.mockImplementationOnce(() => [
      '/package-a',
      '/package-b',
    ]);
    runPublish({
      isYarn: true,
      config: {
        publishCommand: ({ defaultCommand }) => defaultCommand,
        monorepo: {},
      },
      releaseTag: 'latest',
      dir: '.',
      dryRun: false,
    });
    expect(output).toMatchInlineSnapshot(`
      Array [
        "› Publishing.",
github algolia / shipjs / packages / shipjs / src / step / prepare / __tests__ / updateVersionMonorepo.spec.js View on Github external
it('works', () => {
    expandPackageList.mockImplementationOnce(() => [
      'packages/a',
      'packages/b',
    ]);
    const versionUpdated = jest.fn();
    updateVersionMonorepo({
      config: {
        versionUpdated,
        monorepo: {
          packagesToBump: ['packages/*'],
          mainVersionFile: 'lerna.json',
        },
      },
      dir: '.',
      nextVersion: '1.2.3',
      releaseType: 'patch',
    });