1
0
Fork 0
toolkit/packages/cache/__tests__/cache.test.ts

15 lines
428 B
TypeScript
Raw Normal View History

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)
} finally {
delete process.env['ACTIONS_CACHE_URL']
}
})
2022-03-24 18:55:03 +00:00
test('isFeatureAvailable returns false if server url is not set', () => {
expect(cache.isFeatureAvailable()).toBe(false)
})