2023-11-17 06:45:51 +00:00
|
|
|
import * as cache from '../src/cache'
|
|
|
|
|
|
|
|
test('isFeatureAvailable returns true if server url is set', () => {
|
|
|
|
try {
|
2024-04-10 04:44:06 +00:00
|
|
|
process.env['WARPBUILD_CACHE_URL'] = 'http://cache.com'
|
2023-11-17 06:45:51 +00:00
|
|
|
expect(cache.isFeatureAvailable()).toBe(true)
|
|
|
|
} finally {
|
2024-04-10 04:44:06 +00:00
|
|
|
delete process.env['WARPBUILD_CACHE_URL']
|
2023-11-17 06:45:51 +00:00
|
|
|
}
|
|
|
|
})
|
|
|
|
|
|
|
|
test('isFeatureAvailable returns false if server url is not set', () => {
|
|
|
|
expect(cache.isFeatureAvailable()).toBe(false)
|
|
|
|
})
|