@@ -54,7 +54,10 @@ describe('pushing tags', function () {
5454
5555 expect ( ( ) =>
5656 pushTags (
57- { useAuxiliaryPackagesOnly : false } ,
57+ {
58+ isDryRun : false ,
59+ useAuxiliaryPackagesOnly : false ,
60+ } ,
5861 listNpmPackages ,
5962 existsVersionTag ,
6063 spawnSync
@@ -65,6 +68,7 @@ describe('pushing tags', function () {
6568 it ( 'takes mongosh version and pushes tags when releasing' , function ( ) {
6669 pushTags (
6770 {
71+ isDryRun : false ,
6872 useAuxiliaryPackagesOnly : false ,
6973 } ,
7074 listNpmPackages ,
@@ -95,6 +99,7 @@ describe('pushing tags', function () {
9599 it ( 'pushes only package tags when using auxiliary packages' , function ( ) {
96100 pushTags (
97101 {
102+ isDryRun : false ,
98103 useAuxiliaryPackagesOnly : true ,
99104 } ,
100105 listNpmPackages ,
@@ -146,6 +151,7 @@ describe('pushing tags', function () {
146151
147152 pushTags (
148153 {
154+ isDryRun : false ,
149155 useAuxiliaryPackagesOnly : true ,
150156 } ,
151157 listNpmPackages ,
@@ -194,6 +200,7 @@ describe('pushing tags', function () {
194200 pushTags (
195201 {
196202 useAuxiliaryPackagesOnly : false ,
203+ isDryRun : false ,
197204 } ,
198205 listNpmPackages ,
199206 existsVersionTag ,
@@ -209,5 +216,29 @@ describe('pushing tags', function () {
209216 ] ) ;
210217 expect ( spawnSync ) . calledWith ( 'git' , [ 'push' , '--follow-tags' ] ) ;
211218 } ) ;
219+
220+ it ( 'skips tag push if it is a dry run' , function ( ) {
221+ existsVersionTag . withArgs ( `v${ mongoshVersion } ` ) . returns ( true ) ;
222+
223+ pushTags (
224+ {
225+ useAuxiliaryPackagesOnly : false ,
226+ isDryRun : true ,
227+ } ,
228+ listNpmPackages ,
229+ existsVersionTag ,
230+ spawnSync
231+ ) ;
232+
233+ expect ( spawnSync ) . not . calledWith ( 'git' , [
234+ 'tag' ,
235+ '-a' ,
236+ `v${ mongoshVersion } ` ,
237+ '-m' ,
238+ `v${ mongoshVersion } ` ,
239+ ] ) ;
240+
241+ expect ( spawnSync ) . not . calledWith ( 'git' , [ 'push' , '--follow-tags' ] ) ;
242+ } ) ;
212243 } ) ;
213244} ) ;
0 commit comments