fix: correctly handle skipped releases
This commit is contained in:
		
							parent
							
								
									70c68ef3ed
								
							
						
					
					
						commit
						1243f79064
					
				| @ -71,9 +71,9 @@ module.exports = { | ||||
|     pipelineConfig: () => ({ | ||||
|       // Add `nextRelease` and plugin properties to published release
 | ||||
|       transform: (release, step, {nextRelease}) => ({ | ||||
|         ...(isPlainObject(release) ? release : {}), | ||||
|         ...nextRelease, | ||||
|         ...(release === false ? {} : step), | ||||
|         ...(release === false ? {} : nextRelease), | ||||
|         ...release, | ||||
|         ...step, | ||||
|       }), | ||||
|     }), | ||||
|   }, | ||||
|  | ||||
| @ -712,6 +712,7 @@ test('Accept "undefined" value returned by "generateNotes" and "false" by "publi | ||||
|   const notes2 = 'Release notes 2'; | ||||
|   const generateNotes2 = stub().resolves(notes2); | ||||
|   const publish = stub().resolves(false); | ||||
|   const success = stub().resolves(); | ||||
| 
 | ||||
|   const options = { | ||||
|     branch: 'master', | ||||
| @ -722,7 +723,7 @@ test('Accept "undefined" value returned by "generateNotes" and "false" by "publi | ||||
|     generateNotes: [generateNotes1, generateNotes2], | ||||
|     prepare: stub().resolves(), | ||||
|     publish, | ||||
|     success: stub().resolves(), | ||||
|     success, | ||||
|     fail: stub().resolves(), | ||||
|   }; | ||||
| 
 | ||||
| @ -754,6 +755,9 @@ test('Accept "undefined" value returned by "generateNotes" and "false" by "publi | ||||
|   t.is(publish.callCount, 1); | ||||
|   t.deepEqual(publish.args[0][1].lastRelease, lastRelease); | ||||
|   t.is(publish.args[0][1].nextRelease.notes, notes2); | ||||
| 
 | ||||
|   t.is(success.callCount, 1); | ||||
|   t.deepEqual(success.args[0][1].releases, [{pluginName: '[Function: proxy]'}]); | ||||
| }); | ||||
| 
 | ||||
| test('Returns false if triggered by a PR', async t => { | ||||
|  | ||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user