@@ -118,6 +118,8 @@ async function setupGitRepo(testRepo: string, testRemote: string) {
118118 }
119119
120120 await exec ( 'git' , [ 'push' , '-u' , 'origin' , branchName ] , { nodeOptions : { cwd : testRepo } } )
121+ await exec ( 'git' , [ 'tag' , 'v1.0.0' ] , { nodeOptions : { cwd : testRepo } } )
122+ await exec ( 'git' , [ 'push' , 'origin' , 'v1.0.0' ] , { nodeOptions : { cwd : testRepo } } )
121123}
122124
123125function cleanupSandbox ( testSandbox ?: string ) {
@@ -269,7 +271,7 @@ describe('release E2E (real git)', () => {
269271
270272 expect ( existsSync ( join ( testRepo , 'CHANGELOG.md' ) ) ) . toBe ( false )
271273 const tags = await exec ( 'git' , [ 'tag' ] , { nodeOptions : { cwd : testRepo } } )
272- expect ( tags . stdout . trim ( ) ) . toBe ( ' ')
274+ expect ( tags . stdout . trim ( ) ) . toContain ( 'v1.0.0 ')
273275
274276 expect ( readJSONSync ( join ( testRepo , 'package.json' ) ) . version ) . toBe ( '1.0.0' )
275277 expect ( readJSONSync ( workspacePkgPath ) . version ) . toBe ( '1.0.0' )
@@ -289,10 +291,10 @@ describe('release E2E (real git)', () => {
289291 expect ( loggerMock . error . mock . calls ) . toEqual ( [ ] )
290292 expect ( readJSONSync ( join ( testRepo , 'package.json' ) ) . version ) . toBe ( '1.0.1' )
291293 expect ( existsSync ( join ( testRepo , 'CHANGELOG.md' ) ) ) . toBe ( true )
292- expect ( await getGitTags ( testRepo ) ) . toBe ( '' )
294+ expect ( await getGitTags ( testRepo ) ) . toBe ( 'v1.0.0 ' )
293295 expect (
294296 ( await exec ( 'git' , [ 'ls-remote' , '--tags' , 'origin' ] , { nodeOptions : { cwd : testRepo } } ) ) . stdout . trim ( ) ,
295- ) . toBe ( ' ')
297+ ) . toContain ( 'refs/tags/v1.0.0 ')
296298 expect ( await getCommitCount ( testRepo ) ) . toBe ( '3' )
297299 } )
298300} )
0 commit comments