mirror of
				https://github.com/actions/setup-java.git
				synced 2025-11-04 00:10:54 +00:00 
			
		
		
		
	Add unit test
This commit is contained in:
		
					parent
					
						
							
								0a93947425
							
						
					
				
			
			
				commit
				
					
						d88ee5c3dc
					
				
			
		
					 3 changed files with 21 additions and 2 deletions
				
			
		| 
						 | 
				
			
			@ -241,3 +241,22 @@ describe('getAvailableVersions', () => {
 | 
			
		|||
    spyGetDownloadArchiveExtension.mockReturnValue(mockedExtension);
 | 
			
		||||
  };
 | 
			
		||||
});
 | 
			
		||||
 | 
			
		||||
describe('convertVersionToSemver', () => {
 | 
			
		||||
  it.each([
 | 
			
		||||
    ['12', '12'],
 | 
			
		||||
    ['12.0', '12.0'],
 | 
			
		||||
    ['12.0.2', '12.0.2'],
 | 
			
		||||
    ['12.0.2+1', '12.0.2+1'],
 | 
			
		||||
    ['12.0.2.1.0', '12.0.2+1.0']
 | 
			
		||||
  ])('%s -> %s', (input: string, expected: string) => {
 | 
			
		||||
    const distribution = new CorrettoDistribution({
 | 
			
		||||
      version: '12',
 | 
			
		||||
      architecture: 'x86',
 | 
			
		||||
      packageType: 'jdk',
 | 
			
		||||
      checkLatest: false
 | 
			
		||||
    });
 | 
			
		||||
    const actual = distribution['convertVersionToSemver'](input);
 | 
			
		||||
    expect(actual).toBe(expected);
 | 
			
		||||
  });
 | 
			
		||||
});
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue