Skip to content

Commit c6d8afe

Browse files
authored
fix(ci): fix build tests for pushing tags (#2353)
--follow-tags was replaced with --tags but the corresponding tests were not fully updated
1 parent 9109842 commit c6d8afe

File tree

2 files changed

+6
-14
lines changed

2 files changed

+6
-14
lines changed

packages/build/src/npm-packages/publish.spec.ts

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ import sinon from 'sinon';
55
import { publishToNpm } from './publish';
66

77
describe('npm-packages publishToNpm', function () {
8-
let listNpmPackages: SinonStub;
98
let spawnSync: SinonStub;
109
const lernaBin = path.resolve(
1110
__dirname,
@@ -19,18 +18,11 @@ describe('npm-packages publishToNpm', function () {
1918
);
2019

2120
beforeEach(function () {
22-
listNpmPackages = sinon.stub();
2321
spawnSync = sinon.stub();
2422
});
2523

2624
it('calls lerna to publish packages for a real version', function () {
27-
const packages = [
28-
{ name: 'packageA', version: '0.7.0' },
29-
{ name: 'mongosh', version: '1.2.0' },
30-
];
31-
listNpmPackages.returns(packages);
32-
33-
publishToNpm({ isDryRun: false }, listNpmPackages);
25+
publishToNpm({ isDryRun: false }, spawnSync);
3426

3527
expect(spawnSync).to.have.been.calledWith(
3628
lernaBin,

packages/build/src/npm-packages/push-tags.spec.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ describe('pushing tags', function () {
9393
'-m',
9494
`v${mongoshVersion}`,
9595
]);
96-
expect(spawnSync).calledWith('git', ['push', '--follow-tags']);
96+
expect(spawnSync).calledWith('git', ['push', '--tags']);
9797
});
9898

9999
it('pushes only package tags when using auxiliary packages', function () {
@@ -134,7 +134,7 @@ describe('pushing tags', function () {
134134
'-m',
135135
`v${mongoshVersion}`,
136136
]);
137-
expect(spawnSync).calledWith('git', ['push', '--follow-tags']);
137+
expect(spawnSync).calledWith('git', ['push', '--tags']);
138138
});
139139

140140
it('skips pushing version tags which already exist', function () {
@@ -191,7 +191,7 @@ describe('pushing tags', function () {
191191
'-m',
192192
`v${mongoshVersion}`,
193193
]);
194-
expect(spawnSync).calledWith('git', ['push', '--follow-tags']);
194+
expect(spawnSync).calledWith('git', ['push', '--tags']);
195195
});
196196

197197
it('skips mongosh release tag push if it exists', function () {
@@ -214,7 +214,7 @@ describe('pushing tags', function () {
214214
'-m',
215215
`v${mongoshVersion}`,
216216
]);
217-
expect(spawnSync).calledWith('git', ['push', '--follow-tags']);
217+
expect(spawnSync).calledWith('git', ['push', '--tags']);
218218
});
219219

220220
it('skips tag push if it is a dry run', function () {
@@ -238,7 +238,7 @@ describe('pushing tags', function () {
238238
`v${mongoshVersion}`,
239239
]);
240240

241-
expect(spawnSync).not.calledWith('git', ['push', '--follow-tags']);
241+
expect(spawnSync).not.calledWith('git', ['push', '--tags']);
242242
});
243243
});
244244
});

0 commit comments

Comments
 (0)