diff --git a/lib/config/presets/github/index.spec.ts b/lib/config/presets/github/index.spec.ts index 6c125f99636285590028bab111732804890383cd..f84c1de6e8402a9c45be9420497676537f840b8d 100644 --- a/lib/config/presets/github/index.spec.ts +++ b/lib/config/presets/github/index.spec.ts @@ -2,7 +2,7 @@ import { mocked } from '../../../../test/util'; import { PLATFORM_FAILURE } from '../../../constants/error-messages'; import { GotResponse } from '../../../platform'; import * as globalCache from '../../../util/cache/global'; -import { clear } from '../../../util/cache/run'; +import * as runCache from '../../../util/cache/run'; import _got from '../../../util/got'; import * as _hostRules from '../../../util/host-rules'; import * as github from '.'; @@ -21,7 +21,7 @@ describe('config/presets/github', () => { }); describe('fetchJSONFile()', () => { beforeEach(() => { - clear(); + runCache.clear(); }); it('returns JSON', async () => { hostRules.find.mockReturnValueOnce({ token: 'abc' }); diff --git a/lib/datasource/docker/index.spec.ts b/lib/datasource/docker/index.spec.ts index 1f43eb7a451f7c7ec6eb643e96847e999f0c26b8..299b6e93b1352e47c16592e561a1460e69c9df44 100644 --- a/lib/datasource/docker/index.spec.ts +++ b/lib/datasource/docker/index.spec.ts @@ -3,7 +3,7 @@ import AWSMock from 'aws-sdk-mock'; import { getPkgReleases } from '..'; import { DATASOURCE_FAILURE } from '../../constants/error-messages'; import * as globalCache from '../../util/cache/global'; -import { clear } from '../../util/cache/run'; +import * as runCache from '../../util/cache/run'; import _got from '../../util/got'; import * as _hostRules from '../../util/host-rules'; import * as docker from '.'; @@ -31,7 +31,7 @@ describe('api/docker', () => { describe('getDigest', () => { beforeEach(() => { jest.resetAllMocks(); - clear(); + runCache.clear(); hostRules.find.mockReturnValue({ username: 'some-username', password: 'some-password', @@ -281,7 +281,7 @@ describe('api/docker', () => { describe('getReleases', () => { beforeEach(() => { jest.clearAllMocks(); - clear(); + runCache.clear(); return globalCache.rmAll(); }); it('returns null if no token', async () => { diff --git a/lib/datasource/npm/index.spec.ts b/lib/datasource/npm/index.spec.ts index 28a459063fa825ea14d160d6134272599e15369c..4e05002ee04c1b1ae27f457acbb58dc6eb03d495 100644 --- a/lib/datasource/npm/index.spec.ts +++ b/lib/datasource/npm/index.spec.ts @@ -4,7 +4,7 @@ import _registryAuthToken from 'registry-auth-token'; import { getName } from '../../../test/util'; import { DATASOURCE_FAILURE } from '../../constants/error-messages'; import * as globalCache from '../../util/cache/global'; -import { clear } from '../../util/cache/run'; +import * as runCache from '../../util/cache/run'; import * as hostRules from '../../util/host-rules'; import * as npm from '.'; @@ -27,7 +27,7 @@ describe(getName(__filename), () => { delete process.env.NPM_TOKEN; beforeEach(() => { jest.resetAllMocks(); - clear(); + runCache.clear(); global.trustLevel = 'low'; npm.resetCache(); npm.setNpmrc(); diff --git a/lib/datasource/packagist/index.spec.ts b/lib/datasource/packagist/index.spec.ts index 6892d3b3296fba54be5ae3282ccf0eba3e49fb71..8b056ddaf45c9cafefeb432069f3442051286955 100644 --- a/lib/datasource/packagist/index.spec.ts +++ b/lib/datasource/packagist/index.spec.ts @@ -1,6 +1,6 @@ import fs from 'fs'; import * as globalCache from '../../util/cache/global'; -import { clear } from '../../util/cache/run'; +import * as runCache from '../../util/cache/run'; import _got from '../../util/got'; import * as _hostRules from '../../util/host-rules'; import * as composerVersioning from '../../versioning/composer'; @@ -29,7 +29,7 @@ describe('datasource/packagist', () => { jest.resetAllMocks(); hostRules.find = jest.fn((input) => input); hostRules.hosts = jest.fn(() => []); - clear(); + runCache.clear(); config = { versioning: composerVersioning.id, registryUrls: [ diff --git a/lib/datasource/pod/index.spec.ts b/lib/datasource/pod/index.spec.ts index 6e86043b604e94c34753e40b1ac0a263a8c65ff2..49c650025409e5984a9341cc457a9b5132045765 100644 --- a/lib/datasource/pod/index.spec.ts +++ b/lib/datasource/pod/index.spec.ts @@ -3,7 +3,7 @@ import { mocked } from '../../../test/util'; import { GotResponse } from '../../platform'; import { api as _api } from '../../platform/github/gh-got-wrapper'; import * as globalCache from '../../util/cache/global'; -import { clear } from '../../util/cache/run'; +import * as runCache from '../../util/cache/run'; import * as rubyVersioning from '../../versioning/ruby'; import * as pod from '.'; @@ -22,7 +22,7 @@ describe('datasource/cocoapods', () => { describe('getReleases', () => { beforeEach(() => { jest.resetAllMocks(); - clear(); + runCache.clear(); return globalCache.rmAll(); }); diff --git a/lib/datasource/rubygems/index.spec.ts b/lib/datasource/rubygems/index.spec.ts index b3047628db6bafca3d2cfed7ace2378c7cbf48d9..143e9a6f1e8efb32edef01d9f3c576bc900ee7cb 100644 --- a/lib/datasource/rubygems/index.spec.ts +++ b/lib/datasource/rubygems/index.spec.ts @@ -1,5 +1,5 @@ import { getPkgReleases } from '..'; -import { clear } from '../../util/cache/run'; +import * as runCache from '../../util/cache/run'; import _got from '../../util/got'; import * as rubyVersioning from '../../versioning/ruby'; import railsInfo from './__fixtures__/rails/info.json'; @@ -46,7 +46,7 @@ describe('datasource/rubygems', () => { }); afterEach(() => { - clear(); + runCache.clear(); process.env.RENOVATE_SKIP_CACHE = SKIP_CACHE; }); diff --git a/lib/manager/gradle-wrapper/artifacts.spec.ts b/lib/manager/gradle-wrapper/artifacts.spec.ts index a1916f637442e98162ae81bb53df9b53b45f3a41..2b89c6543590d28b15c461cd55aa378af4179833 100644 --- a/lib/manager/gradle-wrapper/artifacts.spec.ts +++ b/lib/manager/gradle-wrapper/artifacts.spec.ts @@ -9,7 +9,7 @@ import { platform, } from '../../../test/util'; import { setUtilConfig } from '../../util'; -import { clear } from '../../util/cache/run'; +import * as runCache from '../../util/cache/run'; import { ifSystemSupportsGradle } from '../gradle/__testutil__/gradle'; import * as dcUpdate from '.'; @@ -43,7 +43,7 @@ describe(getName(__filename), () => { jest.resetAllMocks(); await setUtilConfig(config); httpMock.setup(); - clear(); + runCache.clear(); }); afterEach(async () => { diff --git a/lib/platform/github/index.spec.ts b/lib/platform/github/index.spec.ts index 3456d492ad6af832bbe5b1f4818ffdadec4726f9..c65111248127757024d16661752a39bc3d0f7ce7 100644 --- a/lib/platform/github/index.spec.ts +++ b/lib/platform/github/index.spec.ts @@ -7,7 +7,7 @@ import { REPOSITORY_RENAMED, } from '../../constants/error-messages'; import { BranchStatus } from '../../types'; -import { clear } from '../../util/cache/run'; +import * as runCache from '../../util/cache/run'; import { Platform } from '../common'; const githubApiHost = 'https://api.github.com'; @@ -57,7 +57,7 @@ describe('platform/github', () => { afterEach(() => { httpMock.reset(); - clear(); + runCache.clear(); }); const graphqlOpenPullRequests = fs.readFileSync( diff --git a/lib/util/cache/run.spec.ts b/lib/util/cache/run.spec.ts index 22009941c2c9b0f985f46d9fcdc44eeb8d9c6947..68611a5612b0f5c169220acb546cf12d5c9192a4 100644 --- a/lib/util/cache/run.spec.ts +++ b/lib/util/cache/run.spec.ts @@ -1,11 +1,11 @@ -import { clear, get, set } from './run'; +import * as runCache from './run'; describe('getRepoCache', () => { it('sets and gets repo cache', () => { - set('key', 'value'); - expect(get('key')).toEqual('value'); + runCache.set('key', 'value'); + expect(runCache.get('key')).toEqual('value'); }); it('clears repo cache', () => { - clear(); + runCache.clear(); }); }); diff --git a/lib/util/got/index.spec.ts b/lib/util/got/index.spec.ts index 104dbb26688da46e98430c4ade8c46f6dee5b2bd..a5f76e9a2f75716f101cf065207d4f71b899be7c 100644 --- a/lib/util/got/index.spec.ts +++ b/lib/util/got/index.spec.ts @@ -5,7 +5,7 @@ import { PLATFORM_TYPE_GITHUB, PLATFORM_TYPE_GITLAB, } from '../../constants/platforms'; -import { clear } from '../cache/run'; +import * as runCache from '../cache/run'; import * as hostRules from '../host-rules'; import { GotJSONOptions } from './common'; import { api } from '.'; @@ -20,7 +20,7 @@ describe(getName(__filename), () => { afterEach(() => { nock.cleanAll(); hostRules.clear(); - clear(); + runCache.clear(); nock.enableNetConnect(); }); @@ -97,7 +97,7 @@ describe(getName(__filename), () => { await got({ hostType: PLATFORM_TYPE_GITHUB, method: 'HEAD' }) ).toMatchSnapshot(); - clear(); + runCache.clear(); await expect(got({ hostType: PLATFORM_TYPE_GITHUB })).rejects.toThrowError( 'not-found' diff --git a/lib/util/http/github.spec.ts b/lib/util/http/github.spec.ts index 9c80c7724c3cb8906d93a1fe4930f8e2b6cd735e..3e9847d2520ff516f50ad036ca6df3ac79c0cd1b 100644 --- a/lib/util/http/github.spec.ts +++ b/lib/util/http/github.spec.ts @@ -8,7 +8,7 @@ import { PLATFORM_RATE_LIMIT_EXCEEDED, REPOSITORY_CHANGED, } from '../../constants/error-messages'; -import { clear } from '../cache/run'; +import * as runCache from '../cache/run'; import { GithubHttp, handleGotError, setBaseUrl } from './github'; const githubApiHost = 'https://api.github.com'; @@ -27,7 +27,7 @@ describe(getName(__filename), () => { afterEach(() => { httpMock.reset(); - clear(); + runCache.clear(); }); describe('HTTP', () => { diff --git a/lib/workers/repository/process/lookup/index.spec.ts b/lib/workers/repository/process/lookup/index.spec.ts index fa032dc2cf198b757eb964c6b04166517a691ff0..f4f377c7cd90eab17690c737f11743163a22b61c 100644 --- a/lib/workers/repository/process/lookup/index.spec.ts +++ b/lib/workers/repository/process/lookup/index.spec.ts @@ -14,7 +14,7 @@ import * as datasourceGithubTags from '../../../../datasource/github-tags'; import * as datasourceNpm from '../../../../datasource/npm'; import * as datasourcePackagist from '../../../../datasource/packagist'; import * as datasourcePypi from '../../../../datasource/pypi'; -import { clear } from '../../../../util/cache/run'; +import * as runCache from '../../../../util/cache/run'; import * as dockerVersioning from '../../../../versioning/docker'; import * as gitVersioning from '../../../../versioning/git'; import * as npmVersioning from '../../../../versioning/npm'; @@ -39,7 +39,7 @@ describe('workers/repository/process/lookup', () => { config.manager = 'npm'; config.versioning = npmVersioning.id; config.rangeStrategy = 'replace'; - clear(); + runCache.clear(); jest.resetAllMocks(); });