mirror of
				https://github.com/actions/setup-node.git
				synced 2025-10-31 08:04:00 +08:00 
			
		
		
		
	Expand current syntax to support aliases for latest version (current/latest/node) (#483)
This commit is contained in:
		| @@ -909,4 +909,30 @@ describe('setup-node', () => { | ||||
|       ); | ||||
|     }); | ||||
|   }); | ||||
|  | ||||
|   describe('latest alias syntax', () => { | ||||
|     it.each(['latest', 'current', 'node'])( | ||||
|       'download the %s version if alias is provided', | ||||
|       async inputVersion => { | ||||
|         // Arrange | ||||
|         inputs['node-version'] = inputVersion; | ||||
|  | ||||
|         os.platform = 'darwin'; | ||||
|         os.arch = 'x64'; | ||||
|  | ||||
|         findSpy.mockImplementation(() => ''); | ||||
|         getManifestSpy.mockImplementation(() => { | ||||
|           throw new Error('Unable to download manifest'); | ||||
|         }); | ||||
|  | ||||
|         // Act | ||||
|         await main.run(); | ||||
|  | ||||
|         // assert | ||||
|         expect(logSpy).toHaveBeenCalledWith('Unable to download manifest'); | ||||
|  | ||||
|         expect(logSpy).toHaveBeenCalledWith('getting latest node version...'); | ||||
|       } | ||||
|     ); | ||||
|   }); | ||||
| }); | ||||
|   | ||||
		Reference in New Issue
	
	Block a user
	 Milos Pantic
					Milos Pantic