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