mirror of
				https://hub.gitmirror.com/https://github.com/gradle/actions.git
				synced 2025-11-04 12:00:01 +08:00 
			
		
		
		
	Noticed had missing imports in tests, this adds them and orders imports consistently. Not sure why eslint missed this.
		
			
				
	
	
		
			23 lines
		
	
	
		
			865 B
		
	
	
	
		
			TypeScript
		
	
	
	
	
	
			
		
		
	
	
			23 lines
		
	
	
		
			865 B
		
	
	
	
		
			TypeScript
		
	
	
	
	
	
import {describe, expect, it} from '@jest/globals'
 | 
						|
 | 
						|
import * as cacheUtils from '../../src/caching/cache-utils'
 | 
						|
 | 
						|
describe('cacheUtils-utils', () => {
 | 
						|
    describe('can hash', () => {
 | 
						|
        it('a string', async () => {
 | 
						|
            const hash = cacheUtils.hashStrings(['foo'])
 | 
						|
            expect(hash).toBe('acbd18db4cc2f85cedef654fccc4a4d8')
 | 
						|
        })
 | 
						|
        it('multiple strings', async () => {
 | 
						|
            const hash = cacheUtils.hashStrings(['foo', 'bar', 'baz'])
 | 
						|
            expect(hash).toBe('6df23dc03f9b54cc38a0fc1483df6e21')
 | 
						|
        })
 | 
						|
        it('normalized filenames', async () => {
 | 
						|
            const fileNames = ['/foo/bar/baz.zip', '../boo.html']
 | 
						|
            const posixHash = cacheUtils.hashFileNames(fileNames)
 | 
						|
            const windowsHash = cacheUtils.hashFileNames(fileNames)
 | 
						|
            expect(posixHash).toBe(windowsHash)
 | 
						|
        })
 | 
						|
    })
 | 
						|
})
 |