@@ -75,6 +75,7 @@ describe('publish command (e2e)', () => {
7575 disallowedChangeTypes : null ,
7676 defaultNpmTag : 'latest' ,
7777 retries : 3 ,
78+ bump : true ,
7879 } ) ;
7980
8081 const showResult = npm ( [ '--registry' , registry . getUrl ( ) , 'show' , 'foo' , '--json' ] ) ;
@@ -94,6 +95,68 @@ describe('publish command (e2e)', () => {
9495 expect ( gitResults . stdout ) . toBe ( 'foo_v1.1.0' ) ;
9596 } ) ;
9697
98+ it ( 'can perform a successful npm publish without bump' , async ( ) => {
99+ repositoryFactory = new RepositoryFactory ( ) ;
100+ await repositoryFactory . create ( ) ;
101+ const repo = await repositoryFactory . cloneRepository ( ) ;
102+
103+ writeChangeFiles (
104+ {
105+ foo : {
106+ type : 'minor' ,
107+ comment : 'test' ,
108+ date : new Date ( '2019-01-01' ) ,
109+ email : 'test@test.com' ,
110+ packageName : 'foo' ,
111+ dependentChangeType : 'patch' ,
112+ } ,
113+ } ,
114+ repo . rootPath
115+ ) ;
116+
117+ git ( [ 'push' , 'origin' , 'master' ] , { cwd : repo . rootPath } ) ;
118+
119+ await publish ( {
120+ branch : 'origin/master' ,
121+ command : 'publish' ,
122+ message : 'apply package updates' ,
123+ path : repo . rootPath ,
124+ publish : true ,
125+ bumpDeps : true ,
126+ push : true ,
127+ registry : registry . getUrl ( ) ,
128+ gitTags : true ,
129+ tag : 'latest' ,
130+ token : '' ,
131+ yes : true ,
132+ new : false ,
133+ access : 'public' ,
134+ package : '' ,
135+ changehint : 'Run "beachball change" to create a change file' ,
136+ type : null ,
137+ fetch : true ,
138+ disallowedChangeTypes : null ,
139+ defaultNpmTag : 'latest' ,
140+ retries : 3 ,
141+ bump : false ,
142+ } ) ;
143+
144+ const showResult = npm ( [ '--registry' , registry . getUrl ( ) , 'show' , 'foo' , '--json' ] ) ;
145+
146+ expect ( showResult . success ) . toBeTruthy ( ) ;
147+
148+ const show = JSON . parse ( showResult . stdout ) ;
149+ expect ( show . name ) . toEqual ( 'foo' ) ;
150+ expect ( show . versions . length ) . toEqual ( 1 ) ;
151+ expect ( show [ 'dist-tags' ] . latest ) . toEqual ( '1.0.0' ) ;
152+
153+ git ( [ 'checkout' , 'master' ] , { cwd : repo . rootPath } ) ;
154+ git ( [ 'pull' ] , { cwd : repo . rootPath } ) ;
155+
156+ const gitResults = git ( [ 'describe' , '--abbrev=0' ] , { cwd : repo . rootPath } ) ;
157+ expect ( gitResults . success ) . toBeFalsy ( ) ;
158+ } ) ;
159+
97160 it ( 'should not perform npm publish on out-of-scope package' , async ( ) => {
98161 repositoryFactory = new MonoRepoFactory ( ) ;
99162 await repositoryFactory . create ( ) ;
@@ -152,6 +215,7 @@ describe('publish command (e2e)', () => {
152215 defaultNpmTag : 'latest' ,
153216 scope : [ '!packages/foo' ] ,
154217 retries : 3 ,
218+ bump : true ,
155219 } ) ;
156220
157221 const fooNpmResult = npm ( [ '--registry' , registry . getUrl ( ) , 'show' , 'foo' , '--json' ] ) ;
@@ -220,6 +284,7 @@ describe('publish command (e2e)', () => {
220284 disallowedChangeTypes : null ,
221285 defaultNpmTag : 'latest' ,
222286 retries : 3 ,
287+ bump : true ,
223288 hooks : {
224289 prepublish : ( packagePath : string ) => {
225290 const packageJsonPath = path . join ( packagePath , 'package.json' ) ;
0 commit comments