From 861d32cef87f2b06fe2c0b91efeb244ecc7a50a3 Mon Sep 17 00:00:00 2001 From: gagik Date: Tue, 4 Feb 2025 13:06:13 +0100 Subject: [PATCH] fix(ci): fix build tests for pushing tags --follow-tags was replaced with --tags but the corresponding tests were not fully updated. --- packages/build/src/npm-packages/publish.spec.ts | 10 +--------- packages/build/src/npm-packages/push-tags.spec.ts | 10 +++++----- 2 files changed, 6 insertions(+), 14 deletions(-) diff --git a/packages/build/src/npm-packages/publish.spec.ts b/packages/build/src/npm-packages/publish.spec.ts index 34c9c5984e..a682238e55 100644 --- a/packages/build/src/npm-packages/publish.spec.ts +++ b/packages/build/src/npm-packages/publish.spec.ts @@ -5,7 +5,6 @@ import sinon from 'sinon'; import { publishToNpm } from './publish'; describe('npm-packages publishToNpm', function () { - let listNpmPackages: SinonStub; let spawnSync: SinonStub; const lernaBin = path.resolve( __dirname, @@ -19,18 +18,11 @@ describe('npm-packages publishToNpm', function () { ); beforeEach(function () { - listNpmPackages = sinon.stub(); spawnSync = sinon.stub(); }); it('calls lerna to publish packages for a real version', function () { - const packages = [ - { name: 'packageA', version: '0.7.0' }, - { name: 'mongosh', version: '1.2.0' }, - ]; - listNpmPackages.returns(packages); - - publishToNpm({ isDryRun: false }, listNpmPackages); + publishToNpm({ isDryRun: false }, spawnSync); expect(spawnSync).to.have.been.calledWith( lernaBin, diff --git a/packages/build/src/npm-packages/push-tags.spec.ts b/packages/build/src/npm-packages/push-tags.spec.ts index 83395f5907..0d135e0655 100644 --- a/packages/build/src/npm-packages/push-tags.spec.ts +++ b/packages/build/src/npm-packages/push-tags.spec.ts @@ -93,7 +93,7 @@ describe('pushing tags', function () { '-m', `v${mongoshVersion}`, ]); - expect(spawnSync).calledWith('git', ['push', '--follow-tags']); + expect(spawnSync).calledWith('git', ['push', '--tags']); }); it('pushes only package tags when using auxiliary packages', function () { @@ -134,7 +134,7 @@ describe('pushing tags', function () { '-m', `v${mongoshVersion}`, ]); - expect(spawnSync).calledWith('git', ['push', '--follow-tags']); + expect(spawnSync).calledWith('git', ['push', '--tags']); }); it('skips pushing version tags which already exist', function () { @@ -191,7 +191,7 @@ describe('pushing tags', function () { '-m', `v${mongoshVersion}`, ]); - expect(spawnSync).calledWith('git', ['push', '--follow-tags']); + expect(spawnSync).calledWith('git', ['push', '--tags']); }); it('skips mongosh release tag push if it exists', function () { @@ -214,7 +214,7 @@ describe('pushing tags', function () { '-m', `v${mongoshVersion}`, ]); - expect(spawnSync).calledWith('git', ['push', '--follow-tags']); + expect(spawnSync).calledWith('git', ['push', '--tags']); }); it('skips tag push if it is a dry run', function () { @@ -238,7 +238,7 @@ describe('pushing tags', function () { `v${mongoshVersion}`, ]); - expect(spawnSync).not.calledWith('git', ['push', '--follow-tags']); + expect(spawnSync).not.calledWith('git', ['push', '--tags']); }); }); });