style: prettier formatting
This commit is contained in:
		
							parent
							
								
									9575198266
								
							
						
					
					
						commit
						b2b7b57fbd
					
				| @ -17,9 +17,11 @@ module.exports = async ({cwd, env, lastRelease: {gitHead}, logger}) => { | |||||||
|   } |   } | ||||||
| 
 | 
 | ||||||
|   Object.assign(gitLogParser.fields, {hash: 'H', message: 'B', gitTags: 'd', committerDate: {key: 'ci', type: Date}}); |   Object.assign(gitLogParser.fields, {hash: 'H', message: 'B', gitTags: 'd', committerDate: {key: 'ci', type: Date}}); | ||||||
|   const commits = (await getStream.array( |   const commits = ( | ||||||
|     gitLogParser.parse({_: `${gitHead ? gitHead + '..' : ''}HEAD`}, {cwd, env: {...process.env, ...env}}) |     await getStream.array( | ||||||
|   )).map(commit => { |       gitLogParser.parse({_: `${gitHead ? gitHead + '..' : ''}HEAD`}, {cwd, env: {...process.env, ...env}}) | ||||||
|  |     ) | ||||||
|  |   ).map(commit => { | ||||||
|     commit.message = commit.message.trim(); |     commit.message = commit.message.trim(); | ||||||
|     commit.gitTags = commit.gitTags.trim(); |     commit.gitTags = commit.gitTags.trim(); | ||||||
|     return commit; |     return commit; | ||||||
|  | |||||||
| @ -87,9 +87,11 @@ export async function gitCommits(messages, execaOpts) { | |||||||
|  */ |  */ | ||||||
| export async function gitGetCommits(from, execaOpts) { | export async function gitGetCommits(from, execaOpts) { | ||||||
|   Object.assign(gitLogParser.fields, {hash: 'H', message: 'B', gitTags: 'd', committerDate: {key: 'ci', type: Date}}); |   Object.assign(gitLogParser.fields, {hash: 'H', message: 'B', gitTags: 'd', committerDate: {key: 'ci', type: Date}}); | ||||||
|   return (await getStream.array( |   return ( | ||||||
|     gitLogParser.parse({_: `${from ? from + '..' : ''}HEAD`}, {...execaOpts, env: {...process.env, ...execaOpts.env}}) |     await getStream.array( | ||||||
|   )).map(commit => { |       gitLogParser.parse({_: `${from ? from + '..' : ''}HEAD`}, {...execaOpts, env: {...process.env, ...execaOpts.env}}) | ||||||
|  |     ) | ||||||
|  |   ).map(commit => { | ||||||
|     commit.message = commit.message.trim(); |     commit.message = commit.message.trim(); | ||||||
|     commit.gitTags = commit.gitTags.trim(); |     commit.gitTags = commit.gitTags.trim(); | ||||||
|     return commit; |     return commit; | ||||||
|  | |||||||
| @ -47,7 +47,12 @@ test('Execute each function in series passing the "lastResult" and "result" to " | |||||||
|   const result = await pipeline([step1, step2, step3, step4], {settleAll: false, getNextInput})(5); |   const result = await pipeline([step1, step2, step3, step4], {settleAll: false, getNextInput})(5); | ||||||
| 
 | 
 | ||||||
|   t.deepEqual(result, [1, 2, 3, 4]); |   t.deepEqual(result, [1, 2, 3, 4]); | ||||||
|   t.deepEqual(getNextInput.args, [[5, 1], [5, 2], [5, 3], [5, 4]]); |   t.deepEqual(getNextInput.args, [ | ||||||
|  |     [5, 1], | ||||||
|  |     [5, 2], | ||||||
|  |     [5, 3], | ||||||
|  |     [5, 4], | ||||||
|  |   ]); | ||||||
| }); | }); | ||||||
| 
 | 
 | ||||||
| test('Execute each function in series calling "transform" to modify the results', async t => { | test('Execute each function in series calling "transform" to modify the results', async t => { | ||||||
| @ -61,7 +66,12 @@ test('Execute each function in series calling "transform" to modify the results' | |||||||
|   const result = await pipeline([step1, step2, step3, step4], {getNextInput, transform})(5); |   const result = await pipeline([step1, step2, step3, step4], {getNextInput, transform})(5); | ||||||
| 
 | 
 | ||||||
|   t.deepEqual(result, [1 + 1, 2 + 1, 3 + 1, 4 + 1]); |   t.deepEqual(result, [1 + 1, 2 + 1, 3 + 1, 4 + 1]); | ||||||
|   t.deepEqual(getNextInput.args, [[5, 1 + 1], [5, 2 + 1], [5, 3 + 1], [5, 4 + 1]]); |   t.deepEqual(getNextInput.args, [ | ||||||
|  |     [5, 1 + 1], | ||||||
|  |     [5, 2 + 1], | ||||||
|  |     [5, 3 + 1], | ||||||
|  |     [5, 4 + 1], | ||||||
|  |   ]); | ||||||
| }); | }); | ||||||
| 
 | 
 | ||||||
| test('Execute each function in series calling "transform" to modify the results with "settleAll"', async t => { | test('Execute each function in series calling "transform" to modify the results with "settleAll"', async t => { | ||||||
| @ -75,7 +85,12 @@ test('Execute each function in series calling "transform" to modify the results | |||||||
|   const result = await pipeline([step1, step2, step3, step4], {settleAll: true, getNextInput, transform})(5); |   const result = await pipeline([step1, step2, step3, step4], {settleAll: true, getNextInput, transform})(5); | ||||||
| 
 | 
 | ||||||
|   t.deepEqual(result, [1 + 1, 2 + 1, 3 + 1, 4 + 1]); |   t.deepEqual(result, [1 + 1, 2 + 1, 3 + 1, 4 + 1]); | ||||||
|   t.deepEqual(getNextInput.args, [[5, 1 + 1], [5, 2 + 1], [5, 3 + 1], [5, 4 + 1]]); |   t.deepEqual(getNextInput.args, [ | ||||||
|  |     [5, 1 + 1], | ||||||
|  |     [5, 2 + 1], | ||||||
|  |     [5, 3 + 1], | ||||||
|  |     [5, 4 + 1], | ||||||
|  |   ]); | ||||||
| }); | }); | ||||||
| 
 | 
 | ||||||
| test('Stop execution and throw error if a step rejects', async t => { | test('Stop execution and throw error if a step rejects', async t => { | ||||||
|  | |||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user