mirror of
https://github.com/gradle/gradle-build-action.git
synced 2024-12-25 16:16:18 +08:00
26b92e3f5c
- Upgraded `samples/basic` to use latest Gradle version.
34 lines
1.4 KiB
TypeScript
34 lines
1.4 KiB
TypeScript
import * as cacheWrapper from '../src/cache-wrapper'
|
|
import * as path from 'path'
|
|
|
|
describe('cache', () => {
|
|
describe('can extract gradle wrapper slug', () => {
|
|
it('from wrapper properties file', async () => {
|
|
const version = cacheWrapper.extractGradleWrapperSlugFrom(
|
|
path.resolve(
|
|
'__tests__/data/cache-wrapper-test/gradle-wrapper.properties'
|
|
)
|
|
)
|
|
expect(version).toBe('6.6.1-bin')
|
|
})
|
|
it('for -bin dist', async () => {
|
|
const version = cacheWrapper.extractGradleWrapperSlugFromDistUri(
|
|
'distributionUrl=https\\://services.gradle.org/distributions/gradle-6.6.1-bin.zip'
|
|
)
|
|
expect(version).toBe('6.6.1-bin')
|
|
})
|
|
it('for -all dist', async () => {
|
|
const version = cacheWrapper.extractGradleWrapperSlugFromDistUri(
|
|
'distributionUrl=https\\://services.gradle.org/distributions/gradle-6.6.1-all.zip'
|
|
)
|
|
expect(version).toBe('6.6.1-all')
|
|
})
|
|
it('for milestone', async () => {
|
|
const version = cacheWrapper.extractGradleWrapperSlugFromDistUri(
|
|
'distributionUrl=https\\://services.gradle.org/distributions/gradle-6.6-milestone-1-all.zip'
|
|
)
|
|
expect(version).toBe('6.6-milestone-1-all')
|
|
})
|
|
})
|
|
})
|