2022-03-24 18:32:17 +00:00
|
|
|
import * as cache from '../src/cache'
|
|
|
|
|
|
|
|
test('isFeatureAvailable returns true if server url is set', () => {
|
2022-03-24 18:55:03 +00:00
|
|
|
try {
|
2022-03-24 18:32:17 +00:00
|
|
|
process.env['ACTIONS_CACHE_URL'] = 'http://cache.com'
|
|
|
|
expect(cache.isFeatureAvailable()).toBe(true)
|
2022-03-24 18:56:40 +00:00
|
|
|
} finally {
|
2022-03-24 18:32:17 +00:00
|
|
|
delete process.env['ACTIONS_CACHE_URL']
|
2022-03-24 18:56:40 +00:00
|
|
|
}
|
|
|
|
})
|
2022-03-24 18:55:03 +00:00
|
|
|
|
|
|
|
test('isFeatureAvailable returns false if server url is not set', () => {
|
|
|
|
expect(cache.isFeatureAvailable()).toBe(false)
|
|
|
|
})
|