mirror of
https://github.com/gradle/gradle-build-action.git
synced 2024-12-25 15:36:20 +08:00
777a6fc967
Attempt to capture as much context as possible about the job run to generate a unique cache key. Unfortunately much of the matrix context is not available to the action implementation.
16 lines
523 B
TypeScript
16 lines
523 B
TypeScript
import * as cacheUtils from '../src/cache-utils'
|
|
import * as path from 'path'
|
|
|
|
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')
|
|
})
|
|
})
|
|
})
|