diff --git a/lib/config/cli.spec.ts b/lib/config/cli.spec.ts index bf95f618d9d984..7e97cb21c5af43 100644 --- a/lib/config/cli.spec.ts +++ b/lib/config/cli.spec.ts @@ -4,7 +4,7 @@ import * as cli from './cli'; import getArgv from './config/__fixtures__/argv'; import type { RenovateOptions } from './types'; -describe(getName(__filename), () => { +describe(getName(), () => { let argv: string[]; beforeEach(() => { argv = getArgv(); diff --git a/lib/config/decrypt.spec.ts b/lib/config/decrypt.spec.ts index c79072a5159fab..3dfc0b95ad7327 100644 --- a/lib/config/decrypt.spec.ts +++ b/lib/config/decrypt.spec.ts @@ -3,9 +3,9 @@ import { setAdminConfig } from './admin'; import { decryptConfig } from './decrypt'; import type { RenovateConfig } from './types'; -const privateKey = loadFixture(__filename, 'private.pem', 'keys'); +const privateKey = loadFixture('private.pem', 'keys'); -describe(getName(__filename), () => { +describe(getName(), () => { describe('decryptConfig()', () => { let config: RenovateConfig; beforeEach(() => { diff --git a/lib/config/definitions.spec.ts b/lib/config/definitions.spec.ts index 783525fad784cd..d759496c8ccfda 100644 --- a/lib/config/definitions.spec.ts +++ b/lib/config/definitions.spec.ts @@ -5,7 +5,7 @@ jest.mock('../manager', () => ({ getManagers: jest.fn(() => new Map().set('testManager', {})), })); -describe(getName(__filename), () => { +describe(getName(), () => { it('test manager should have no defaultConfig', () => { const opts = getOptions(); expect(opts.filter((o) => o.name === 'testManager')).toEqual([]); diff --git a/lib/config/env.spec.ts b/lib/config/env.spec.ts index 58a08bbfd431de..0f395003cad4bc 100644 --- a/lib/config/env.spec.ts +++ b/lib/config/env.spec.ts @@ -6,7 +6,7 @@ import { import * as env from './env'; import type { RenovateOptions } from './types'; -describe(getName(__filename), () => { +describe(getName(), () => { describe('.getConfig(env)', () => { it('returns empty env', () => { expect(env.getConfig({})).toEqual({ hostRules: [] }); diff --git a/lib/config/file.spec.ts b/lib/config/file.spec.ts index a75f18e7e530fb..eaa768a8047bc1 100644 --- a/lib/config/file.spec.ts +++ b/lib/config/file.spec.ts @@ -5,7 +5,7 @@ import { getName } from '../../test/util'; import customConfig from './config/__fixtures__/file'; import * as file from './file'; -describe(getName(__filename), () => { +describe(getName(), () => { let tmp: DirectoryResult; beforeAll(async () => { diff --git a/lib/config/index.spec.ts b/lib/config/index.spec.ts index 08dd9dd7f14d03..a5a1c4da96f4cb 100644 --- a/lib/config/index.spec.ts +++ b/lib/config/index.spec.ts @@ -13,7 +13,7 @@ try { const defaultConfig = getConfig(); -describe(getName(__filename), () => { +describe(getName(), () => { describe('.parseConfigs(env, defaultArgv)', () => { let configParser: typeof import('.'); let defaultArgv: string[]; diff --git a/lib/config/massage.spec.ts b/lib/config/massage.spec.ts index 19693d5a041230..bcf9d4264748e2 100644 --- a/lib/config/massage.spec.ts +++ b/lib/config/massage.spec.ts @@ -2,7 +2,7 @@ import { getName } from '../../test/util'; import * as massage from './massage'; import type { RenovateConfig } from './types'; -describe(getName(__filename), () => { +describe(getName(), () => { describe('massageConfig', () => { it('returns empty', () => { const config: RenovateConfig = {}; diff --git a/lib/config/migrate-validate.spec.ts b/lib/config/migrate-validate.spec.ts index bd1de334b8a87d..806e227123ba76 100644 --- a/lib/config/migrate-validate.spec.ts +++ b/lib/config/migrate-validate.spec.ts @@ -7,7 +7,7 @@ beforeEach(() => { config = getConfig(); }); -describe(getName(__filename), () => { +describe(getName(), () => { describe('migrateAndValidate()', () => { it('handles empty', async () => { const res = await migrateAndValidate(config, {}); diff --git a/lib/config/migration.spec.ts b/lib/config/migration.spec.ts index eb384c3abe331e..32482d80fa3820 100644 --- a/lib/config/migration.spec.ts +++ b/lib/config/migration.spec.ts @@ -14,7 +14,7 @@ interface RenovateConfig extends _RenovateConfig { node?: RenovateSharedConfig & { supportPolicy?: unknown }; } -describe(getName(__filename), () => { +describe(getName(), () => { describe('migrateConfig(config, parentConfig)', () => { it('migrates config', () => { const config: RenovateConfig = { diff --git a/lib/config/presets/azure/index.spec.ts b/lib/config/presets/azure/index.spec.ts index 03430d19e06f23..3c7e8467aaa54d 100644 --- a/lib/config/presets/azure/index.spec.ts +++ b/lib/config/presets/azure/index.spec.ts @@ -10,7 +10,7 @@ jest.mock('../../../platform/azure/azure-got-wrapper'); const azureApi = mocked(_azureApi); -describe(getName(__filename), () => { +describe(getName(), () => { beforeAll(() => { setPlatformApi('azure'); }); diff --git a/lib/config/presets/bitbucket-server/index.spec.ts b/lib/config/presets/bitbucket-server/index.spec.ts index 443d9643741b02..4aaad95f332645 100644 --- a/lib/config/presets/bitbucket-server/index.spec.ts +++ b/lib/config/presets/bitbucket-server/index.spec.ts @@ -11,7 +11,7 @@ const hostRules = mocked(_hostRules); const bitbucketApiHost = 'https://git.company.org'; const basePath = '/rest/api/1.0/projects/some/repos/repo/browse'; -describe(getName(__filename), () => { +describe(getName(), () => { beforeEach(() => { httpMock.setup(); hostRules.find.mockReturnValue({ token: 'abc' }); diff --git a/lib/config/presets/bitbucket/index.spec.ts b/lib/config/presets/bitbucket/index.spec.ts index f1f97b45d82fc7..cf26c9410dbfcd 100644 --- a/lib/config/presets/bitbucket/index.spec.ts +++ b/lib/config/presets/bitbucket/index.spec.ts @@ -9,7 +9,7 @@ jest.unmock('../../../platform'); const baseUrl = 'https://api.bitbucket.org'; const basePath = '/2.0/repositories/some/repo/src/HEAD'; -describe(getName(__filename), () => { +describe(getName(), () => { beforeAll(() => { setPlatformApi('bitbucket'); }); diff --git a/lib/config/presets/gitea/index.spec.ts b/lib/config/presets/gitea/index.spec.ts index 79baf2260ea97a..5582056521e852 100644 --- a/lib/config/presets/gitea/index.spec.ts +++ b/lib/config/presets/gitea/index.spec.ts @@ -12,7 +12,7 @@ const hostRules = mocked(_hostRules); const giteaApiHost = gitea.Endpoint; const basePath = '/repos/some/repo/contents'; -describe(getName(__filename), () => { +describe(getName(), () => { beforeEach(() => { httpMock.setup(); hostRules.find.mockReturnValue({ token: 'abc' }); diff --git a/lib/config/presets/github/index.spec.ts b/lib/config/presets/github/index.spec.ts index fe95e80d6f1bb8..9e2fffdca405e8 100644 --- a/lib/config/presets/github/index.spec.ts +++ b/lib/config/presets/github/index.spec.ts @@ -11,7 +11,7 @@ const hostRules = mocked(_hostRules); const githubApiHost = github.Endpoint; const basePath = '/repos/some/repo/contents'; -describe(getName(__filename), () => { +describe(getName(), () => { beforeEach(() => { httpMock.setup(); hostRules.find.mockReturnValue({ token: 'abc' }); diff --git a/lib/config/presets/gitlab/index.spec.ts b/lib/config/presets/gitlab/index.spec.ts index c6a4dbe77d88b4..53d32d88bf09f5 100644 --- a/lib/config/presets/gitlab/index.spec.ts +++ b/lib/config/presets/gitlab/index.spec.ts @@ -7,7 +7,7 @@ import * as gitlab from '.'; const gitlabApiHost = 'https://gitlab.com'; const basePath = '/api/v4/projects/some%2Frepo/repository'; -describe(getName(__filename), () => { +describe(getName(), () => { beforeEach(() => { jest.resetAllMocks(); httpMock.setup(); diff --git a/lib/config/presets/index.spec.ts b/lib/config/presets/index.spec.ts index 38e7e4f982ad51..838c6b528749d2 100644 --- a/lib/config/presets/index.spec.ts +++ b/lib/config/presets/index.spec.ts @@ -16,10 +16,7 @@ jest.mock('./local'); const npm = mocked(_npm); const local = mocked(_local); -const presetIkatyang = loadJsonFixture( - __filename, - 'renovate-config-ikatyang.json' -); +const presetIkatyang = loadJsonFixture('renovate-config-ikatyang.json'); npm.getPreset = jest.fn(({ packageName, presetName }) => { if (packageName === 'renovate-config-ikatyang') { @@ -42,7 +39,7 @@ npm.getPreset = jest.fn(({ packageName, presetName }) => { return null; }); -describe(getName(__filename), () => { +describe(getName(), () => { describe('resolvePreset', () => { let config: RenovateConfig; beforeEach(() => { diff --git a/lib/config/presets/internal/index.spec.ts b/lib/config/presets/internal/index.spec.ts index b58b51b3a1822d..0e018bdda8ebfc 100644 --- a/lib/config/presets/internal/index.spec.ts +++ b/lib/config/presets/internal/index.spec.ts @@ -14,7 +14,7 @@ npm.getPreset = jest.fn((_) => null); const ignoredPresets = ['default:group', 'default:timezone']; -describe(getName(__filename), () => { +describe(getName(), () => { it('fails for undefined internal preset', async () => { const preset = 'foo:bar'; const presetConfig = { extends: [preset] }; diff --git a/lib/config/presets/local/index.spec.ts b/lib/config/presets/local/index.spec.ts index 743c7334144d6a..2036f349f66684 100644 --- a/lib/config/presets/local/index.spec.ts +++ b/lib/config/presets/local/index.spec.ts @@ -21,7 +21,7 @@ const gitea = mocked(_gitea); const github = mocked(_github); const gitlab = mocked(_gitlab); -describe(getName(__filename), () => { +describe(getName(), () => { beforeEach(() => { jest.resetAllMocks(); const preset = { resolved: 'preset' }; diff --git a/lib/config/presets/npm/index.spec.ts b/lib/config/presets/npm/index.spec.ts index fa5bd9afd76e95..ea2633e5002be2 100644 --- a/lib/config/presets/npm/index.spec.ts +++ b/lib/config/presets/npm/index.spec.ts @@ -6,7 +6,7 @@ import * as npm from '.'; jest.mock('registry-auth-token'); jest.mock('delay'); -describe(getName(__filename), () => { +describe(getName(), () => { beforeEach(() => { jest.resetAllMocks(); setAdminConfig(); diff --git a/lib/config/presets/util.spec.ts b/lib/config/presets/util.spec.ts index 0bc3cbb4b4a62b..a4a9ff908ac15e 100644 --- a/lib/config/presets/util.spec.ts +++ b/lib/config/presets/util.spec.ts @@ -16,7 +16,7 @@ const config: FetchPresetConfig = { const fetch = jest.fn(() => Promise.resolve({})); -describe(getName(__filename), () => { +describe(getName(), () => { beforeEach(() => { fetch.mockReset(); }); diff --git a/lib/config/secrets.spec.ts b/lib/config/secrets.spec.ts index 1ea2c095baf14d..e1acda13168788 100644 --- a/lib/config/secrets.spec.ts +++ b/lib/config/secrets.spec.ts @@ -5,7 +5,7 @@ import { } from '../constants/error-messages'; import { applySecretsToConfig, validateConfigSecrets } from './secrets'; -describe(getName(__filename), () => { +describe(getName(), () => { describe('validateConfigSecrets(config)', () => { it('works with default config', () => { expect(() => validateConfigSecrets(defaultConfig)).not.toThrow(); diff --git a/lib/config/validation-helpers/managers.spec.ts b/lib/config/validation-helpers/managers.spec.ts index 4b86e32c68776c..e0d89c1dbc5758 100644 --- a/lib/config/validation-helpers/managers.spec.ts +++ b/lib/config/validation-helpers/managers.spec.ts @@ -1,7 +1,7 @@ import { getName } from '../../../test/util'; import { check } from './managers'; -describe(getName(__filename), () => { +describe(getName(), () => { it('should have no errors', () => { const res = check({ resolvedRule: { matchManagers: ['npm'] }, diff --git a/lib/config/validation.spec.ts b/lib/config/validation.spec.ts index 2535fa4318097a..e845672fe50463 100644 --- a/lib/config/validation.spec.ts +++ b/lib/config/validation.spec.ts @@ -2,7 +2,7 @@ import { getName } from '../../test/util'; import type { RenovateConfig } from './types'; import * as configValidation from './validation'; -describe(getName(__filename), () => { +describe(getName(), () => { describe('getParentName()', () => { it('ignores encrypted in root', () => { expect(configValidation.getParentName('encrypted')).toEqual(''); diff --git a/lib/datasource/bitbucket-tags/index.spec.ts b/lib/datasource/bitbucket-tags/index.spec.ts index 87653aa00e3ac2..ab7b800cf490c5 100644 --- a/lib/datasource/bitbucket-tags/index.spec.ts +++ b/lib/datasource/bitbucket-tags/index.spec.ts @@ -3,7 +3,7 @@ import * as httpMock from '../../../test/http-mock'; import { getName } from '../../../test/util'; import { id as datasource } from '.'; -describe(getName(__filename), () => { +describe(getName(), () => { beforeEach(() => { httpMock.reset(); httpMock.setup(); diff --git a/lib/datasource/cdnjs/index.spec.ts b/lib/datasource/cdnjs/index.spec.ts index 6e6165ee1f647d..7819d61c4f9947 100644 --- a/lib/datasource/cdnjs/index.spec.ts +++ b/lib/datasource/cdnjs/index.spec.ts @@ -4,15 +4,15 @@ import { getName, loadFixture } from '../../../test/util'; import { EXTERNAL_HOST_ERROR } from '../../constants/error-messages'; import { id as datasource } from '.'; -const res1 = loadFixture(__filename, 'd3-force.json'); -const res2 = loadFixture(__filename, 'bulma.json'); +const res1 = loadFixture('d3-force.json'); +const res2 = loadFixture('bulma.json'); const baseUrl = 'https://api.cdnjs.com/'; const pathFor = (s: string): string => `/libraries/${s.split('/').shift()}?fields=homepage,repository,assets`; -describe(getName(__filename), () => { +describe(getName(), () => { describe('getReleases', () => { beforeEach(() => { jest.clearAllMocks(); diff --git a/lib/datasource/crate/index.spec.ts b/lib/datasource/crate/index.spec.ts index 8bcf8fe19c08b0..78bf915b7c4e5e 100644 --- a/lib/datasource/crate/index.spec.ts +++ b/lib/datasource/crate/index.spec.ts @@ -20,9 +20,9 @@ import { jest.mock('simple-git'); const simpleGit: any = _simpleGit; -const res1 = loadFixture(__filename, 'libc'); -const res2 = loadFixture(__filename, 'amethyst'); -const res3 = loadFixture(__filename, 'mypkg'); +const res1 = loadFixture('libc'); +const res2 = loadFixture('amethyst'); +const res3 = loadFixture('mypkg'); const baseUrl = 'https://raw.githubusercontent.com/rust-lang/crates.io-index/master/'; @@ -65,7 +65,7 @@ function setupErrorGitMock(): { mockClone: jest.Mock } { return { mockClone }; } -describe(getName(__filename), () => { +describe(getName(), () => { describe('getIndexSuffix', () => { it('returns correct suffixes', () => { expect(getIndexSuffix('a')).toStrictEqual(['1', 'a']); diff --git a/lib/datasource/dart/index.spec.ts b/lib/datasource/dart/index.spec.ts index abc986a028b1bc..a2f69ff1e23a97 100644 --- a/lib/datasource/dart/index.spec.ts +++ b/lib/datasource/dart/index.spec.ts @@ -3,11 +3,11 @@ import * as httpMock from '../../../test/http-mock'; import { getName, loadJsonFixture } from '../../../test/util'; import { id as datasource } from '.'; -const body = loadJsonFixture(__filename, 'shared_preferences.json'); +const body = loadJsonFixture('shared_preferences.json'); const baseUrl = 'https://pub.dartlang.org/api/packages/'; -describe(getName(__filename), () => { +describe(getName(), () => { beforeEach(() => { httpMock.setup(); }); diff --git a/lib/datasource/docker/index.spec.ts b/lib/datasource/docker/index.spec.ts index f317cdb58e7faa..80198179ee67e4 100644 --- a/lib/datasource/docker/index.spec.ts +++ b/lib/datasource/docker/index.spec.ts @@ -41,7 +41,7 @@ function mockEcrAuthReject(msg: string) { ); } -describe(getName(__filename), () => { +describe(getName(), () => { beforeEach(() => { httpMock.setup(); hostRules.find.mockReturnValue({ diff --git a/lib/datasource/galaxy-collection/index.spec.ts b/lib/datasource/galaxy-collection/index.spec.ts index 32acd8d69a10a1..8a5725cb1dbd80 100644 --- a/lib/datasource/galaxy-collection/index.spec.ts +++ b/lib/datasource/galaxy-collection/index.spec.ts @@ -4,30 +4,23 @@ import { getName, loadFixture } from '../../../test/util'; import { id as datasource } from '.'; -const communityKubernetesBase = loadFixture( - __filename, - 'community_kubernetes_base.json' -); +const communityKubernetesBase = loadFixture('community_kubernetes_base.json'); const communityKubernetesVersions = loadFixture( - __filename, 'community_kubernetes_versions.json' ); const communityKubernetesDetails121 = loadFixture( - __filename, 'community_kubernetes_version_details_1.2.1.json' ); const communityKubernetesDetails120 = loadFixture( - __filename, 'community_kubernetes_version_details_1.2.0.json' ); const communityKubernetesDetails0111 = loadFixture( - __filename, 'community_kubernetes_version_details_0.11.1.json' ); const baseUrl = 'https://galaxy.ansible.com'; -describe(getName(__filename), () => { +describe(getName(), () => { describe('getReleases', () => { beforeEach(() => { httpMock.setup(); diff --git a/lib/datasource/galaxy/index.spec.ts b/lib/datasource/galaxy/index.spec.ts index 4786daa7281fa5..c4b16844a45f56 100644 --- a/lib/datasource/galaxy/index.spec.ts +++ b/lib/datasource/galaxy/index.spec.ts @@ -4,12 +4,12 @@ import { getName, loadFixture } from '../../../test/util'; import { id as datasource } from '.'; -const res1 = loadFixture(__filename, 'timezone'); -const empty = loadFixture(__filename, 'empty'); +const res1 = loadFixture('timezone'); +const empty = loadFixture('empty'); const baseUrl = 'https://galaxy.ansible.com/'; -describe(getName(__filename), () => { +describe(getName(), () => { describe('getReleases', () => { beforeEach(() => { httpMock.setup(); diff --git a/lib/datasource/git-refs/index.spec.ts b/lib/datasource/git-refs/index.spec.ts index 5e0dc5c31faac9..744404ae9256c8 100644 --- a/lib/datasource/git-refs/index.spec.ts +++ b/lib/datasource/git-refs/index.spec.ts @@ -8,9 +8,9 @@ const simpleGit: any = _simpleGit; const depName = 'https://github.com/example/example.git'; -const lsRemote1 = loadFixture(__filename, 'ls-remote-1.txt'); +const lsRemote1 = loadFixture('ls-remote-1.txt'); -describe(getName(__filename), () => { +describe(getName(), () => { describe('getReleases', () => { it('returns nil if response is wrong', async () => { simpleGit.mockReturnValue({ diff --git a/lib/datasource/git-tags/index.spec.ts b/lib/datasource/git-tags/index.spec.ts index d1309fa51d89c8..d1e347e2c94e25 100644 --- a/lib/datasource/git-tags/index.spec.ts +++ b/lib/datasource/git-tags/index.spec.ts @@ -8,9 +8,9 @@ const simpleGit: any = _simpleGit; const depName = 'https://github.com/example/example.git'; -const lsRemote1 = loadFixture(__filename, 'ls-remote-1.txt', '../git-refs'); +const lsRemote1 = loadFixture('ls-remote-1.txt', '../git-refs'); -describe(getName(__filename), () => { +describe(getName(), () => { describe('getReleases', () => { it('returns nil if response is wrong', async () => { simpleGit.mockReturnValue({ diff --git a/lib/datasource/github-releases/index.spec.ts b/lib/datasource/github-releases/index.spec.ts index ff5a412431c758..4bf1e18110c932 100644 --- a/lib/datasource/github-releases/index.spec.ts +++ b/lib/datasource/github-releases/index.spec.ts @@ -23,7 +23,7 @@ const responseBody = [ }, ]; -describe(getName(__filename), () => { +describe(getName(), () => { beforeEach(() => { hostRules.hosts.mockReturnValue([]); hostRules.find.mockReturnValue({ diff --git a/lib/datasource/github-tags/index.spec.ts b/lib/datasource/github-tags/index.spec.ts index 06992b6c260177..cd038f8f6c51bf 100644 --- a/lib/datasource/github-tags/index.spec.ts +++ b/lib/datasource/github-tags/index.spec.ts @@ -10,7 +10,7 @@ const hostRules: any = _hostRules; const githubApiHost = 'https://api.github.com'; const githubEnterpriseApiHost = 'https://git.enterprise.com'; -describe(getName(__filename), () => { +describe(getName(), () => { beforeEach(() => { httpMock.reset(); httpMock.setup(); diff --git a/lib/datasource/gitlab-tags/index.spec.ts b/lib/datasource/gitlab-tags/index.spec.ts index f1b08eb58306c9..1b106f37faa734 100644 --- a/lib/datasource/gitlab-tags/index.spec.ts +++ b/lib/datasource/gitlab-tags/index.spec.ts @@ -3,7 +3,7 @@ import * as httpMock from '../../../test/http-mock'; import { getName } from '../../../test/util'; import { id as datasource } from '.'; -describe(getName(__filename), () => { +describe(getName(), () => { beforeEach(() => { httpMock.reset(); httpMock.setup(); diff --git a/lib/datasource/go/index.spec.ts b/lib/datasource/go/index.spec.ts index fe7340408fe7a5..218e810c685f44 100644 --- a/lib/datasource/go/index.spec.ts +++ b/lib/datasource/go/index.spec.ts @@ -46,7 +46,7 @@ const resGitHubEnterprise = ` `; -describe(getName(__filename), () => { +describe(getName(), () => { beforeEach(() => { httpMock.setup(); hostRules.find.mockReturnValue({}); diff --git a/lib/datasource/gradle-version/index.spec.ts b/lib/datasource/gradle-version/index.spec.ts index dd527dc0e1396f..078303f6e647b1 100644 --- a/lib/datasource/gradle-version/index.spec.ts +++ b/lib/datasource/gradle-version/index.spec.ts @@ -5,11 +5,11 @@ import { ExternalHostError } from '../../types/errors/external-host-error'; import { id as versioning } from '../../versioning/gradle'; import { id as datasource, getReleases } from '.'; -const allResponse: any = loadJsonFixture(__filename, 'all.json'); +const allResponse: any = loadJsonFixture('all.json'); let config: GetPkgReleasesConfig; -describe(getName(__filename), () => { +describe(getName(), () => { describe('getReleases', () => { beforeEach(() => { config = { diff --git a/lib/datasource/helm/index.spec.ts b/lib/datasource/helm/index.spec.ts index 37e9a119201c45..ff3a14ed97537f 100644 --- a/lib/datasource/helm/index.spec.ts +++ b/lib/datasource/helm/index.spec.ts @@ -4,9 +4,9 @@ import { getName, loadFixture } from '../../../test/util'; import { id as datasource } from '.'; // Truncated index.yaml file -const indexYaml = loadFixture(__filename, 'index.yaml'); +const indexYaml = loadFixture('index.yaml'); -describe(getName(__filename), () => { +describe(getName(), () => { describe('getReleases', () => { beforeEach(() => { jest.resetAllMocks(); diff --git a/lib/datasource/hex/index.spec.ts b/lib/datasource/hex/index.spec.ts index 4357cf966fe18c..739be18d1e017a 100644 --- a/lib/datasource/hex/index.spec.ts +++ b/lib/datasource/hex/index.spec.ts @@ -7,13 +7,13 @@ import { id as datasource } from '.'; const hostRules: any = _hostRules; -const res1 = loadJsonFixture(__filename, 'certifi.json'); +const res1 = loadJsonFixture('certifi.json'); jest.mock('../../util/host-rules'); const baseUrl = 'https://hex.pm/api/packages/'; -describe(getName(__filename), () => { +describe(getName(), () => { beforeEach(() => { hostRules.hosts.mockReturnValue([]); hostRules.find.mockReturnValue({}); diff --git a/lib/datasource/index.spec.ts b/lib/datasource/index.spec.ts index 04b1f7c6e64f93..3ccc8fee67a914 100644 --- a/lib/datasource/index.spec.ts +++ b/lib/datasource/index.spec.ts @@ -26,7 +26,7 @@ const mavenDatasource = mocked(datasourceMaven); const npmDatasource = mocked(datasourceNpm); const packagistDatasource = mocked(datasourcePackagist); -describe(getName(__filename), () => { +describe(getName(), () => { beforeEach(() => { jest.resetAllMocks(); }); diff --git a/lib/datasource/jenkins-plugins/index.spec.ts b/lib/datasource/jenkins-plugins/index.spec.ts index 3943760e88860d..0b7fa723353bad 100644 --- a/lib/datasource/jenkins-plugins/index.spec.ts +++ b/lib/datasource/jenkins-plugins/index.spec.ts @@ -5,16 +5,10 @@ import * as versioning from '../../versioning/docker'; import { resetCache } from './get'; import * as jenkins from '.'; -const jenkinsPluginsVersions = loadJsonFixture( - __filename, - 'plugin-versions.json' -); -const jenkinsPluginsInfo = loadJsonFixture( - __filename, - 'update-center.actual.json' -); - -describe(getName(__filename), () => { +const jenkinsPluginsVersions = loadJsonFixture('plugin-versions.json'); +const jenkinsPluginsInfo = loadJsonFixture('update-center.actual.json'); + +describe(getName(), () => { describe('getReleases', () => { const SKIP_CACHE = process.env.RENOVATE_SKIP_CACHE; diff --git a/lib/datasource/maven/index.spec.ts b/lib/datasource/maven/index.spec.ts index 9a411bb8e26bad..33f60510fadc7f 100644 --- a/lib/datasource/maven/index.spec.ts +++ b/lib/datasource/maven/index.spec.ts @@ -9,12 +9,10 @@ import { id as datasource } from '.'; const MYSQL_VERSIONS = ['6.0.5', '6.0.6', '8.0.7', '8.0.8', '8.0.9']; const MYSQL_MAVEN_METADATA = loadFixture( - __filename, 'repo1.maven.org/maven2/mysql/mysql-connector-java/maven-metadata.xml' ); const MYSQL_MAVEN_MYSQL_POM = loadFixture( - __filename, 'repo1.maven.org/maven2/mysql/mysql-connector-java/8.0.12/mysql-connector-java-8.0.12.pom' ); @@ -38,7 +36,7 @@ function generateReleases(versions: string[], ts = false): Release[] { }); } -describe(getName(__filename), () => { +describe(getName(), () => { beforeEach(() => { hostRules.add({ hostType: datasource, diff --git a/lib/datasource/metadata.spec.ts b/lib/datasource/metadata.spec.ts index add5b5fb204367..c630202485651b 100644 --- a/lib/datasource/metadata.spec.ts +++ b/lib/datasource/metadata.spec.ts @@ -4,7 +4,7 @@ import { addMetaData } from './metadata'; import * as datasourceNpm from './npm'; import * as datasourcePypi from './pypi'; -describe(getName(__filename), () => { +describe(getName(), () => { it('Should do nothing if dep is not specified', () => { expect(addMetaData()).toBeUndefined(); }); diff --git a/lib/datasource/npm/get.spec.ts b/lib/datasource/npm/get.spec.ts index 76c91caf8e7b9b..ad56a801cd70ee 100644 --- a/lib/datasource/npm/get.spec.ts +++ b/lib/datasource/npm/get.spec.ts @@ -11,7 +11,7 @@ function getPath(s = ''): string { return `${prePath}/@myco%2Ftest`; } -describe(getName(__filename), () => { +describe(getName(), () => { beforeEach(() => { jest.clearAllMocks(); resetMemCache(); diff --git a/lib/datasource/npm/index.spec.ts b/lib/datasource/npm/index.spec.ts index d398428ebf8c67..a9869c62a3969d 100644 --- a/lib/datasource/npm/index.spec.ts +++ b/lib/datasource/npm/index.spec.ts @@ -14,7 +14,7 @@ jest.mock('delay'); const registryAuthToken: jest.Mock<_registryAuthToken.NpmCredentials> = _registryAuthToken as never; let npmResponse: any; -describe(getName(__filename), () => { +describe(getName(), () => { beforeEach(() => { jest.resetAllMocks(); httpMock.setup(); diff --git a/lib/datasource/npm/npmrc.spec.ts b/lib/datasource/npm/npmrc.spec.ts index ed44bfee821bb1..23ecde3dca2fce 100644 --- a/lib/datasource/npm/npmrc.spec.ts +++ b/lib/datasource/npm/npmrc.spec.ts @@ -7,7 +7,7 @@ jest.mock('../../util/sanitize'); const sanitize = mocked(_sanitize); -describe(getName(__filename), () => { +describe(getName(), () => { beforeEach(() => { setNpmrc(''); setAdminConfig(); diff --git a/lib/datasource/nuget/index.spec.ts b/lib/datasource/nuget/index.spec.ts index 777089b4ec3f87..e741bd6e556e95 100644 --- a/lib/datasource/nuget/index.spec.ts +++ b/lib/datasource/nuget/index.spec.ts @@ -9,48 +9,43 @@ const hostRules: any = _hostRules; jest.mock('../../util/host-rules'); -const pkgInfoV3FromNuget = loadFixture(__filename, 'nunit/v3_nuget_org.xml'); -const pkgListV3Registration = loadFixture( - __filename, - 'nunit/v3_registration.json' -); +const pkgInfoV3FromNuget = loadFixture('nunit/v3_nuget_org.xml'); +const pkgListV3Registration = loadFixture('nunit/v3_registration.json'); -const pkgListV2 = loadFixture(__filename, 'nunit/v2.xml'); +const pkgListV2 = loadFixture('nunit/v2.xml'); const pkgListV2NoGitHubProjectUrl = loadFixture( - __filename, 'nunit/v2_noGitHubProjectUrl.xml' ); -const pkgListV2NoRelease = loadFixture(__filename, 'nunit/v2_no_release.xml'); +const pkgListV2NoRelease = loadFixture('nunit/v2_no_release.xml'); const pkgListV2WithoutProjectUrl = loadFixture( - __filename, 'nunit/v2_withoutProjectUrl.xml' ); -const pkgListV2Page1of2 = loadFixture(__filename, 'nunit/v2_paginated_1.xml'); -const pkgListV2Page2of2 = loadFixture(__filename, 'nunit/v2_paginated_2.xml'); +const pkgListV2Page1of2 = loadFixture('nunit/v2_paginated_1.xml'); +const pkgListV2Page2of2 = loadFixture('nunit/v2_paginated_2.xml'); -const nugetIndexV3 = loadFixture(__filename, 'v3_index.json'); +const nugetIndexV3 = loadFixture('v3_index.json'); const nlogMocks = [ { url: '/v3/registration5-gz-semver2/nlog/index.json', - result: loadFixture(__filename, 'nlog/v3_registration.json'), + result: loadFixture('nlog/v3_registration.json'), }, { url: '/v3/registration5-gz-semver2/nlog/page/1.0.0.505/4.4.0-beta5.json', - result: loadFixture(__filename, 'nlog/v3_catalog_1.json'), + result: loadFixture('nlog/v3_catalog_1.json'), }, { url: '/v3/registration5-gz-semver2/nlog/page/4.4.0-beta6/4.6.0-rc2.json', - result: loadFixture(__filename, 'nlog/v3_catalog_2.json'), + result: loadFixture('nlog/v3_catalog_2.json'), }, { url: '/v3/registration5-gz-semver2/nlog/page/4.6.0-rc3/5.0.0-beta11.json', - result: loadFixture(__filename, 'nlog/v3_catalog_3.json'), + result: loadFixture('nlog/v3_catalog_3.json'), }, { url: '/v3-flatcontainer/nlog/4.7.3/nlog.nuspec', - result: loadFixture(__filename, 'nlog/nuspec.xml'), + result: loadFixture('nlog/nuspec.xml'), }, ]; @@ -95,7 +90,7 @@ const configV3Multiple = { ], }; -describe(getName(__filename), () => { +describe(getName(), () => { describe('parseRegistryUrl', () => { beforeEach(() => { jest.resetAllMocks(); diff --git a/lib/datasource/orb/index.spec.ts b/lib/datasource/orb/index.spec.ts index 6162d340ab7aaa..590ba37c9a2f9d 100644 --- a/lib/datasource/orb/index.spec.ts +++ b/lib/datasource/orb/index.spec.ts @@ -26,7 +26,7 @@ const orbData = { const baseUrl = 'https://circleci.com'; -describe(getName(__filename), () => { +describe(getName(), () => { describe('getReleases', () => { beforeEach(() => { jest.clearAllMocks(); diff --git a/lib/datasource/packagist/index.spec.ts b/lib/datasource/packagist/index.spec.ts index 556339f47b8b59..b0fc54e79ad325 100644 --- a/lib/datasource/packagist/index.spec.ts +++ b/lib/datasource/packagist/index.spec.ts @@ -10,13 +10,13 @@ jest.mock('../../util/host-rules'); const hostRules = _hostRules; -const includesJson: any = loadJsonFixture(__filename, 'includes.json'); -const beytJson: any = loadJsonFixture(__filename, '1beyt.json'); -const mailchimpJson: any = loadJsonFixture(__filename, 'mailchimp-api.json'); +const includesJson: any = loadJsonFixture('includes.json'); +const beytJson: any = loadJsonFixture('1beyt.json'); +const mailchimpJson: any = loadJsonFixture('mailchimp-api.json'); const baseUrl = 'https://packagist.org'; -describe(getName(__filename), () => { +describe(getName(), () => { describe('getReleases', () => { let config: any; beforeEach(() => { diff --git a/lib/datasource/pod/index.spec.ts b/lib/datasource/pod/index.spec.ts index f803877caa9a7b..d5a215b15cad2b 100644 --- a/lib/datasource/pod/index.spec.ts +++ b/lib/datasource/pod/index.spec.ts @@ -15,7 +15,7 @@ const config = { const githubApiHost = 'https://api.github.com'; const cocoapodsHost = 'https://cdn.cocoapods.org'; -describe(getName(__filename), () => { +describe(getName(), () => { describe('getReleases', () => { beforeEach(() => { jest.resetAllMocks(); diff --git a/lib/datasource/pypi/index.spec.ts b/lib/datasource/pypi/index.spec.ts index 6a36bba660daa5..7254733ac0c85e 100644 --- a/lib/datasource/pypi/index.spec.ts +++ b/lib/datasource/pypi/index.spec.ts @@ -4,22 +4,18 @@ import { getName, loadFixture } from '../../../test/util'; import * as hostRules from '../../util/host-rules'; import { id as datasource } from '.'; -const res1: any = loadFixture(__filename, 'azure-cli-monitor.json'); -const res2: any = loadFixture(__filename, 'azure-cli-monitor-updated.json'); -const htmlResponse = loadFixture(__filename, 'versions-html.html'); -const badResponse = loadFixture(__filename, 'versions-html-badfile.html'); +const res1: any = loadFixture('azure-cli-monitor.json'); +const res2: any = loadFixture('azure-cli-monitor-updated.json'); +const htmlResponse = loadFixture('versions-html.html'); +const badResponse = loadFixture('versions-html-badfile.html'); const dataRequiresPythonResponse = loadFixture( - __filename, 'versions-html-data-requires-python.html' ); -const mixedHyphensResponse = loadFixture( - __filename, - 'versions-html-mixed-hyphens.html' -); +const mixedHyphensResponse = loadFixture('versions-html-mixed-hyphens.html'); const baseUrl = 'https://pypi.org/pypi'; -describe(getName(__filename), () => { +describe(getName(), () => { describe('getReleases', () => { const OLD_ENV = process.env; diff --git a/lib/datasource/repology/index.spec.ts b/lib/datasource/repology/index.spec.ts index 9323908ac1642f..e84d7e092aad83 100644 --- a/lib/datasource/repology/index.spec.ts +++ b/lib/datasource/repology/index.spec.ts @@ -45,13 +45,13 @@ const mockResolverCall = ( } }; -const fixtureNginx = loadFixture(__filename, `nginx.json`); -const fixtureGccDefaults = loadFixture(__filename, `gcc-defaults.json`); -const fixtureGcc = loadFixture(__filename, `gcc.json`); -const fixturePulseaudio = loadFixture(__filename, `pulseaudio.json`); -const fixtureJdk = loadFixture(__filename, `openjdk.json`); +const fixtureNginx = loadFixture(`nginx.json`); +const fixtureGccDefaults = loadFixture(`gcc-defaults.json`); +const fixtureGcc = loadFixture(`gcc.json`); +const fixturePulseaudio = loadFixture(`pulseaudio.json`); +const fixtureJdk = loadFixture(`openjdk.json`); -describe(getName(__filename), () => { +describe(getName(), () => { describe('getReleases', () => { beforeEach(() => { httpMock.setup(); diff --git a/lib/datasource/ruby-version/index.spec.ts b/lib/datasource/ruby-version/index.spec.ts index 2f95bcfa918996..d227fc8bf39363 100644 --- a/lib/datasource/ruby-version/index.spec.ts +++ b/lib/datasource/ruby-version/index.spec.ts @@ -3,9 +3,9 @@ import * as httpMock from '../../../test/http-mock'; import { getName, loadFixture } from '../../../test/util'; import { id as datasource } from '.'; -const rubyReleasesHtml = loadFixture(__filename, 'releases.html'); +const rubyReleasesHtml = loadFixture('releases.html'); -describe(getName(__filename), () => { +describe(getName(), () => { describe('getReleases', () => { beforeEach(() => { httpMock.setup(); diff --git a/lib/datasource/rubygems/index.spec.ts b/lib/datasource/rubygems/index.spec.ts index 92df66b559aba3..dce97126fb72f2 100644 --- a/lib/datasource/rubygems/index.spec.ts +++ b/lib/datasource/rubygems/index.spec.ts @@ -5,11 +5,11 @@ import * as rubyVersioning from '../../versioning/ruby'; import { resetCache } from './get-rubygems-org'; import * as rubygems from '.'; -const rubygemsOrgVersions = loadFixture(__filename, 'rubygems-org.txt'); -const railsInfo = loadJsonFixture(__filename, 'rails/info.json'); -const railsVersions = loadJsonFixture(__filename, 'rails/versions.json'); +const rubygemsOrgVersions = loadFixture('rubygems-org.txt'); +const railsInfo = loadJsonFixture('rails/info.json'); +const railsVersions = loadJsonFixture('rails/versions.json'); -describe(getName(__filename), () => { +describe(getName(), () => { describe('getReleases', () => { const SKIP_CACHE = process.env.RENOVATE_SKIP_CACHE; diff --git a/lib/datasource/sbt-package/index.spec.ts b/lib/datasource/sbt-package/index.spec.ts index 2616a41293cae8..b91673e75c027c 100644 --- a/lib/datasource/sbt-package/index.spec.ts +++ b/lib/datasource/sbt-package/index.spec.ts @@ -6,10 +6,10 @@ import { MAVEN_REPO } from '../maven/common'; import { parseIndexDir } from '../sbt-plugin/util'; import * as sbtPlugin from '.'; -const mavenIndexHtml = loadFixture(__filename, `maven-index.html`); -const sbtPluginIndex = loadFixture(__filename, `sbt-plugins-index.html`); +const mavenIndexHtml = loadFixture(`maven-index.html`); +const sbtPluginIndex = loadFixture(`sbt-plugins-index.html`); -describe(getName(__filename), () => { +describe(getName(), () => { it('parses Maven index directory', () => { expect(parseIndexDir(mavenIndexHtml)).toMatchSnapshot(); }); diff --git a/lib/datasource/sbt-plugin/index.spec.ts b/lib/datasource/sbt-plugin/index.spec.ts index b8228ab50091c8..efbc89a82ecd3b 100644 --- a/lib/datasource/sbt-plugin/index.spec.ts +++ b/lib/datasource/sbt-plugin/index.spec.ts @@ -6,10 +6,10 @@ import { MAVEN_REPO } from '../maven/common'; import { parseIndexDir } from './util'; import * as sbtPlugin from '.'; -const mavenIndexHtml = loadFixture(__filename, `maven-index.html`); -const sbtPluginIndex = loadFixture(__filename, `sbt-plugins-index.html`); +const mavenIndexHtml = loadFixture(`maven-index.html`); +const sbtPluginIndex = loadFixture(`sbt-plugins-index.html`); -describe(getName(__filename), () => { +describe(getName(), () => { it('parses Maven index directory', () => { expect(parseIndexDir(mavenIndexHtml)).toMatchSnapshot(); }); diff --git a/lib/datasource/terraform-module/index.spec.ts b/lib/datasource/terraform-module/index.spec.ts index 2d08c2dd29677e..224749e1b7920a 100644 --- a/lib/datasource/terraform-module/index.spec.ts +++ b/lib/datasource/terraform-module/index.spec.ts @@ -3,20 +3,16 @@ import * as httpMock from '../../../test/http-mock'; import { getName, loadFixture } from '../../../test/util'; import { id as datasource } from '.'; -const consulData: any = loadFixture(__filename, 'registry-consul.json'); -const serviceDiscoveryResult: any = loadFixture( - __filename, - 'service-discovery.json' -); +const consulData: any = loadFixture('registry-consul.json'); +const serviceDiscoveryResult: any = loadFixture('service-discovery.json'); const serviceDiscoveryCustomResult: any = loadFixture( - __filename, 'service-custom-discovery.json' ); const baseUrl = 'https://registry.terraform.io'; const localTerraformEnterprisebaseUrl = 'https://terraform.foo.bar'; -describe(getName(__filename), () => { +describe(getName(), () => { describe('getReleases', () => { beforeEach(() => { jest.clearAllMocks(); diff --git a/lib/datasource/terraform-provider/index.spec.ts b/lib/datasource/terraform-provider/index.spec.ts index 44dfa44b294f2e..10a5abb85e8c55 100644 --- a/lib/datasource/terraform-provider/index.spec.ts +++ b/lib/datasource/terraform-provider/index.spec.ts @@ -3,20 +3,14 @@ import * as httpMock from '../../../test/http-mock'; import { getName, loadFixture } from '../../../test/util'; import { id as datasource, defaultRegistryUrls } from '.'; -const consulData: any = loadFixture(__filename, 'azurerm-provider.json'); -const hashicorpReleases: any = loadFixture( - __filename, - 'releaseBackendIndex.json' -); -const serviceDiscoveryResult: any = loadFixture( - __filename, - 'service-discovery.json' -); +const consulData: any = loadFixture('azurerm-provider.json'); +const hashicorpReleases: any = loadFixture('releaseBackendIndex.json'); +const serviceDiscoveryResult: any = loadFixture('service-discovery.json'); const primaryUrl = defaultRegistryUrls[0]; const secondaryUrl = defaultRegistryUrls[1]; -describe(getName(__filename), () => { +describe(getName(), () => { describe('getReleases', () => { beforeEach(() => { jest.clearAllMocks(); diff --git a/lib/logger/config-serializer.spec.ts b/lib/logger/config-serializer.spec.ts index 35472ec7700708..be604e8264f844 100644 --- a/lib/logger/config-serializer.spec.ts +++ b/lib/logger/config-serializer.spec.ts @@ -1,7 +1,7 @@ import { getName } from '../../test/util'; import configSerializer from './config-serializer'; -describe(getName(__filename), () => { +describe(getName(), () => { it('squashes templates', () => { const config = { nottoken: 'b', diff --git a/lib/logger/err-serializer.spec.ts b/lib/logger/err-serializer.spec.ts index bc9e775c3a33a3..0e0ed66ea7ae63 100644 --- a/lib/logger/err-serializer.spec.ts +++ b/lib/logger/err-serializer.spec.ts @@ -5,7 +5,7 @@ import { Http } from '../util/http'; import errSerializer from './err-serializer'; import { sanitizeValue } from './utils'; -describe(getName(__filename), () => { +describe(getName(), () => { it('expands errors', () => { const err = partial>({ a: 1, diff --git a/lib/logger/pretty-stdout.spec.ts b/lib/logger/pretty-stdout.spec.ts index 21a48e48090930..fa43f80d1ff251 100644 --- a/lib/logger/pretty-stdout.spec.ts +++ b/lib/logger/pretty-stdout.spec.ts @@ -10,7 +10,7 @@ jest.mock('chalk', () => ) ); -describe(getName(__filename), () => { +describe(getName(), () => { describe('getMeta(rec)', () => { it('returns empty string if null rec', () => { expect(prettyStdout.getMeta(null as any)).toEqual(''); diff --git a/lib/manager/ansible-galaxy/extract.spec.ts b/lib/manager/ansible-galaxy/extract.spec.ts index dd3593801e3754..0d3ef20bb9bc40 100644 --- a/lib/manager/ansible-galaxy/extract.spec.ts +++ b/lib/manager/ansible-galaxy/extract.spec.ts @@ -1,14 +1,14 @@ import { getName, loadFixture } from '../../../test/util'; import extractPackageFile, { getSliceEndNumber } from './extract'; -const yamlFile1 = loadFixture(__filename, 'requirements01.yml'); -const yamlFile2 = loadFixture(__filename, 'requirements02.yml'); -const helmRequirements = loadFixture(__filename, 'helmRequirements.yml'); -const collections1 = loadFixture(__filename, 'collections1.yml'); -const collections2 = loadFixture(__filename, 'collections2.yml'); -const galaxy = loadFixture(__filename, 'galaxy.yml'); +const yamlFile1 = loadFixture('requirements01.yml'); +const yamlFile2 = loadFixture('requirements02.yml'); +const helmRequirements = loadFixture('helmRequirements.yml'); +const collections1 = loadFixture('collections1.yml'); +const collections2 = loadFixture('collections2.yml'); +const galaxy = loadFixture('galaxy.yml'); -describe(getName(__filename), () => { +describe(getName(), () => { describe('extractPackageFile()', () => { it('returns null for empty', () => { expect(extractPackageFile('nothing here', 'requirements.yml')).toBeNull(); diff --git a/lib/manager/ansible/extract.spec.ts b/lib/manager/ansible/extract.spec.ts index 3e068cf4062230..3c61a5808c2503 100644 --- a/lib/manager/ansible/extract.spec.ts +++ b/lib/manager/ansible/extract.spec.ts @@ -1,10 +1,10 @@ import { getName, loadFixture } from '../../../test/util'; import extractPackageFile from './extract'; -const yamlFile1 = loadFixture(__filename, 'main1.yaml'); -const yamlFile2 = loadFixture(__filename, 'main2.yaml'); +const yamlFile1 = loadFixture('main1.yaml'); +const yamlFile2 = loadFixture('main2.yaml'); -describe(getName(__filename), () => { +describe(getName(), () => { describe('extractPackageFile()', () => { it('returns null for empty', () => { expect(extractPackageFile('nothing here')).toBeNull(); diff --git a/lib/manager/azure-pipelines/extract.spec.ts b/lib/manager/azure-pipelines/extract.spec.ts index 72dd4fcfad25d8..b3f3ad4d0edfd4 100644 --- a/lib/manager/azure-pipelines/extract.spec.ts +++ b/lib/manager/azure-pipelines/extract.spec.ts @@ -6,19 +6,15 @@ import { parseAzurePipelines, } from './extract'; -const azurePipelines = loadFixture(__filename, 'azure-pipelines.yaml'); +const azurePipelines = loadFixture('azure-pipelines.yaml'); -const azurePipelinesInvalid = loadFixture( - __filename, - 'azure-pipelines-invalid.yaml' -); +const azurePipelinesInvalid = loadFixture('azure-pipelines-invalid.yaml'); const azurePipelinesNoDependency = loadFixture( - __filename, 'azure-pipelines-no-dependency.yaml' ); -describe(getName(__filename), () => { +describe(getName(), () => { it('should parse a valid azure-pipelines file', () => { const file = parseAzurePipelines(azurePipelines, 'some-file'); expect(file).not.toBeNull(); diff --git a/lib/manager/batect-wrapper/artifacts.spec.ts b/lib/manager/batect-wrapper/artifacts.spec.ts index 2b0698923f8200..1d14f7b76fd1aa 100644 --- a/lib/manager/batect-wrapper/artifacts.spec.ts +++ b/lib/manager/batect-wrapper/artifacts.spec.ts @@ -21,7 +21,7 @@ function artifactForPath( }; } -describe(getName(__filename), () => { +describe(getName(), () => { beforeEach(() => { httpMock.setup(); diff --git a/lib/manager/batect-wrapper/extract.spec.ts b/lib/manager/batect-wrapper/extract.spec.ts index 06393f3cd2f7e5..6735e3c6544783 100644 --- a/lib/manager/batect-wrapper/extract.spec.ts +++ b/lib/manager/batect-wrapper/extract.spec.ts @@ -4,10 +4,10 @@ import { id as semverVersioning } from '../../versioning/semver'; import type { PackageDependency } from '../types'; import { extractPackageFile } from './extract'; -const validWrapperContent = loadFixture(__filename, 'valid-wrapper'); -const malformedWrapperContent = loadFixture(__filename, 'malformed-wrapper'); +const validWrapperContent = loadFixture('valid-wrapper'); +const malformedWrapperContent = loadFixture('malformed-wrapper'); -describe(getName(__filename), () => { +describe(getName(), () => { describe('extractPackageFile()', () => { it('returns null for empty wrapper file', () => { expect(extractPackageFile('')).toBeNull(); diff --git a/lib/manager/batect/extract.spec.ts b/lib/manager/batect/extract.spec.ts index 7c4a09c7e31d8a..590e80b652333f 100644 --- a/lib/manager/batect/extract.spec.ts +++ b/lib/manager/batect/extract.spec.ts @@ -25,7 +25,7 @@ function createGitDependency(repo: string, version: string): PackageDependency { }; } -describe(getName(__filename), () => { +describe(getName(), () => { describe('extractPackageFile()', () => { it('returns empty array for empty configuration file', async () => { expect( diff --git a/lib/manager/bazel/extract.spec.ts b/lib/manager/bazel/extract.spec.ts index be6a208c17bbfd..01a534d90c757c 100644 --- a/lib/manager/bazel/extract.spec.ts +++ b/lib/manager/bazel/extract.spec.ts @@ -1,12 +1,12 @@ import { getName, loadFixture } from '../../../test/util'; import { extractPackageFile } from './extract'; -const workspaceFile = loadFixture(__filename, 'WORKSPACE1'); -const workspace2File = loadFixture(__filename, 'WORKSPACE2'); -const workspace3File = loadFixture(__filename, 'WORKSPACE3'); -const fileWithBzlExtension = loadFixture(__filename, 'repositories.bzl'); +const workspaceFile = loadFixture('WORKSPACE1'); +const workspace2File = loadFixture('WORKSPACE2'); +const workspace3File = loadFixture('WORKSPACE3'); +const fileWithBzlExtension = loadFixture('repositories.bzl'); -describe(getName(__filename), () => { +describe(getName(), () => { describe('extractPackageFile()', () => { it('returns empty if fails to parse', () => { const res = extractPackageFile('blahhhhh:foo:@what\n'); diff --git a/lib/manager/bazel/update.spec.ts b/lib/manager/bazel/update.spec.ts index db2b6bc82a6009..368c092205f325 100644 --- a/lib/manager/bazel/update.spec.ts +++ b/lib/manager/bazel/update.spec.ts @@ -4,9 +4,9 @@ import { getName, loadFixture } from '../../../test/util'; import type { UpdateType } from '../../config/types'; import { updateDependency } from './update'; -const content = loadFixture(__filename, 'WORKSPACE1'); -const contentContainerPull = loadFixture(__filename, 'container_pull'); -const fileWithBzlExtension = loadFixture(__filename, 'repositories.bzl'); +const content = loadFixture('WORKSPACE1'); +const contentContainerPull = loadFixture('container_pull'); +const fileWithBzlExtension = loadFixture('repositories.bzl'); /* git_repository( @@ -16,7 +16,7 @@ git_repository( ) */ -describe(getName(__filename), () => { +describe(getName(), () => { describe('updateDependency', () => { beforeEach(() => { jest.resetAllMocks(); diff --git a/lib/manager/buildkite/extract.spec.ts b/lib/manager/buildkite/extract.spec.ts index 911da7d3c9bf3a..f49d3405c70130 100644 --- a/lib/manager/buildkite/extract.spec.ts +++ b/lib/manager/buildkite/extract.spec.ts @@ -1,12 +1,12 @@ import { getName, loadFixture } from '../../../test/util'; import { extractPackageFile } from './extract'; -const pipeline1 = loadFixture(__filename, 'pipeline1.yml'); -const pipeline2 = loadFixture(__filename, 'pipeline2.yml'); -const pipeline3 = loadFixture(__filename, 'pipeline3.yml'); -const pipeline4 = loadFixture(__filename, 'pipeline4.yml'); +const pipeline1 = loadFixture('pipeline1.yml'); +const pipeline2 = loadFixture('pipeline2.yml'); +const pipeline3 = loadFixture('pipeline3.yml'); +const pipeline4 = loadFixture('pipeline4.yml'); -describe(getName(__filename), () => { +describe(getName(), () => { describe('extractPackageFile()', () => { it('returns null for empty', () => { expect(extractPackageFile('nothing here')).toBeNull(); diff --git a/lib/manager/bundler/extract.spec.ts b/lib/manager/bundler/extract.spec.ts index baefc8e48a5df9..c02f69cf23949f 100644 --- a/lib/manager/bundler/extract.spec.ts +++ b/lib/manager/bundler/extract.spec.ts @@ -4,29 +4,24 @@ import { extractPackageFile } from './extract'; jest.mock('../../util/fs'); -const railsGemfile = loadFixture(__filename, 'Gemfile.rails'); -const railsGemfileLock = loadFixture(__filename, 'Gemfile.rails.lock'); +const railsGemfile = loadFixture('Gemfile.rails'); +const railsGemfileLock = loadFixture('Gemfile.rails.lock'); -const sourceGroupGemfile = loadFixture(__filename, 'Gemfile.sourceGroup'); -const webPackerGemfile = loadFixture(__filename, 'Gemfile.webpacker'); -const webPackerGemfileLock = loadFixture(__filename, 'Gemfile.webpacker.lock'); -const mastodonGemfile = loadFixture(__filename, 'Gemfile.mastodon'); -const mastodonGemfileLock = loadFixture(__filename, 'Gemfile.mastodon.lock'); -const rubyCIGemfileLock = loadFixture(__filename, 'Gemfile.rubyci.lock'); +const sourceGroupGemfile = loadFixture('Gemfile.sourceGroup'); +const webPackerGemfile = loadFixture('Gemfile.webpacker'); +const webPackerGemfileLock = loadFixture('Gemfile.webpacker.lock'); +const mastodonGemfile = loadFixture('Gemfile.mastodon'); +const mastodonGemfileLock = loadFixture('Gemfile.mastodon.lock'); +const rubyCIGemfileLock = loadFixture('Gemfile.rubyci.lock'); -const rubyCIGemfile = loadFixture(__filename, 'Gemfile.rubyci'); -const gitlabFossGemfileLock = loadFixture( - __filename, - 'Gemfile.gitlab-foss.lock' -); -const gitlabFossGemfile = loadFixture(__filename, 'Gemfile.gitlab-foss'); -const sourceBlockGemfile = loadFixture(__filename, 'Gemfile.sourceBlock'); +const rubyCIGemfile = loadFixture('Gemfile.rubyci'); +const gitlabFossGemfileLock = loadFixture('Gemfile.gitlab-foss.lock'); +const gitlabFossGemfile = loadFixture('Gemfile.gitlab-foss'); +const sourceBlockGemfile = loadFixture('Gemfile.sourceBlock'); const sourceBlockWithNewLinesGemfileLock = loadFixture( - __filename, 'Gemfile.sourceBlockWithNewLines.lock' ); const sourceBlockWithNewLinesGemfile = loadFixture( - __filename, 'Gemfile.sourceBlockWithNewLines' ); @@ -36,7 +31,7 @@ function validateGems(raw, parsed) { expect(gemfileGemCount).toEqual(parsedGemCount); } -describe(getName(__filename), () => { +describe(getName(), () => { describe('extractPackageFile()', () => { it('returns null for empty', async () => { expect(await extractPackageFile('nothing here', 'Gemfile')).toBeNull(); diff --git a/lib/manager/bundler/gemfile.spec.ts b/lib/manager/bundler/gemfile.spec.ts index a066c10e2f6017..2bb334da4b78ec 100644 --- a/lib/manager/bundler/gemfile.spec.ts +++ b/lib/manager/bundler/gemfile.spec.ts @@ -1,7 +1,7 @@ import { loadFixture } from '../../../test/util'; import { extractLockFileEntries } from './locked-version'; -const gemLockFile = loadFixture(__filename, 'Gemfile.rails.lock'); +const gemLockFile = loadFixture('Gemfile.rails.lock'); describe('extract lib/manager/bundler/gemfile.rails.lock', () => { it('matches the expected output', () => { diff --git a/lib/manager/bundler/host-rules.spec.ts b/lib/manager/bundler/host-rules.spec.ts index 5997c081cb9b2d..8df6aa5d6f2c08 100644 --- a/lib/manager/bundler/host-rules.spec.ts +++ b/lib/manager/bundler/host-rules.spec.ts @@ -8,7 +8,7 @@ import { getDomain, } from './host-rules'; -describe(getName(__filename), () => { +describe(getName(), () => { beforeEach(() => { clear(); }); diff --git a/lib/manager/bundler/locked-version.spec.ts b/lib/manager/bundler/locked-version.spec.ts index 6401691b7bb25f..40a33017738536 100644 --- a/lib/manager/bundler/locked-version.spec.ts +++ b/lib/manager/bundler/locked-version.spec.ts @@ -1,14 +1,11 @@ import { loadFixture } from '../../../test/util'; import { extractLockFileEntries } from './locked-version'; -const railsGemfileLock = loadFixture(__filename, 'Gemfile.rails.lock'); -const webPackerGemfileLock = loadFixture(__filename, 'Gemfile.webpacker.lock'); -const mastodonGemfileLock = loadFixture(__filename, 'Gemfile.mastodon.lock'); -const rubyCIGemfileLock = loadFixture(__filename, 'Gemfile.rubyci.lock'); -const gitlabFossGemfileLock = loadFixture( - __filename, - 'Gemfile.gitlab-foss.lock' -); +const railsGemfileLock = loadFixture('Gemfile.rails.lock'); +const webPackerGemfileLock = loadFixture('Gemfile.webpacker.lock'); +const mastodonGemfileLock = loadFixture('Gemfile.mastodon.lock'); +const rubyCIGemfileLock = loadFixture('Gemfile.rubyci.lock'); +const gitlabFossGemfileLock = loadFixture('Gemfile.gitlab-foss.lock'); describe('/lib/manager/bundler/locked-version', () => { test('Parse Rails Gem Lock File', () => { diff --git a/lib/manager/bundler/range.spec.ts b/lib/manager/bundler/range.spec.ts index af31efddb120d6..01f2f41deda15d 100644 --- a/lib/manager/bundler/range.spec.ts +++ b/lib/manager/bundler/range.spec.ts @@ -2,7 +2,7 @@ import { getName } from '../../../test/util'; import type { RangeConfig } from '../types'; import { getRangeStrategy } from '.'; -describe(getName(__filename), () => { +describe(getName(), () => { describe('getRangeStrategy()', () => { it('returns replace when rangeStrategy is auto', () => { const config: RangeConfig = { rangeStrategy: 'auto' }; diff --git a/lib/manager/cake/index.spec.ts b/lib/manager/cake/index.spec.ts index eae570413174cd..c135e06b1ec719 100644 --- a/lib/manager/cake/index.spec.ts +++ b/lib/manager/cake/index.spec.ts @@ -1,9 +1,9 @@ import { getName, loadFixture } from '../../../test/util'; import { extractPackageFile } from '.'; -const content = loadFixture(__filename, 'build.cake'); +const content = loadFixture('build.cake'); -describe(getName(__filename), () => { +describe(getName(), () => { it('extracts', () => { expect(extractPackageFile(content)).toMatchSnapshot(); }); diff --git a/lib/manager/cargo/extract.spec.ts b/lib/manager/cargo/extract.spec.ts index 761785d8031a7f..7c4db8abeb4fb8 100644 --- a/lib/manager/cargo/extract.spec.ts +++ b/lib/manager/cargo/extract.spec.ts @@ -4,15 +4,15 @@ import { getName, loadFixture } from '../../../test/util'; import { setFsConfig, writeLocalFile } from '../../util/fs'; import { extractPackageFile } from './extract'; -const cargo1toml = loadFixture(__filename, 'Cargo.1.toml'); -const cargo2toml = loadFixture(__filename, 'Cargo.2.toml'); -const cargo3toml = loadFixture(__filename, 'Cargo.3.toml'); -const cargo4toml = loadFixture(__filename, 'Cargo.4.toml'); -const cargo5toml = loadFixture(__filename, 'Cargo.5.toml'); -const cargo6configtoml = loadFixture(__filename, 'cargo.6.config.toml'); -const cargo6toml = loadFixture(__filename, 'Cargo.6.toml'); +const cargo1toml = loadFixture('Cargo.1.toml'); +const cargo2toml = loadFixture('Cargo.2.toml'); +const cargo3toml = loadFixture('Cargo.3.toml'); +const cargo4toml = loadFixture('Cargo.4.toml'); +const cargo5toml = loadFixture('Cargo.5.toml'); +const cargo6configtoml = loadFixture('cargo.6.config.toml'); +const cargo6toml = loadFixture('Cargo.6.toml'); -describe(getName(__filename), () => { +describe(getName(), () => { describe('extractPackageFile()', () => { let config; beforeEach(() => { diff --git a/lib/manager/cdnurl/extract.spec.ts b/lib/manager/cdnurl/extract.spec.ts index 7d03a1539fed13..47382fef62b32f 100644 --- a/lib/manager/cdnurl/extract.spec.ts +++ b/lib/manager/cdnurl/extract.spec.ts @@ -1,9 +1,9 @@ import { getName, loadFixture } from '../../../test/util'; import { extractPackageFile } from '.'; -const input = loadFixture(__filename, `sample.txt`); +const input = loadFixture(`sample.txt`); -describe(getName(__filename), () => { +describe(getName(), () => { it('extractPackageFile', () => { expect(extractPackageFile(input)).toMatchSnapshot(); }); diff --git a/lib/manager/circleci/extract.spec.ts b/lib/manager/circleci/extract.spec.ts index dc31c4a5a59b5c..087e374e42a820 100644 --- a/lib/manager/circleci/extract.spec.ts +++ b/lib/manager/circleci/extract.spec.ts @@ -1,11 +1,11 @@ import { getName, loadFixture } from '../../../test/util'; import { extractPackageFile } from './extract'; -const file1 = loadFixture(__filename, 'config.yml'); -const file2 = loadFixture(__filename, 'config2.yml'); -const file3 = loadFixture(__filename, 'config3.yml'); +const file1 = loadFixture('config.yml'); +const file2 = loadFixture('config2.yml'); +const file3 = loadFixture('config3.yml'); -describe(getName(__filename), () => { +describe(getName(), () => { describe('extractPackageFile()', () => { it('returns null for empty', () => { expect(extractPackageFile('nothing here')).toBeNull(); diff --git a/lib/manager/cloudbuild/extract.spec.ts b/lib/manager/cloudbuild/extract.spec.ts index 4301cf5ccec8bb..1724d763afae83 100644 --- a/lib/manager/cloudbuild/extract.spec.ts +++ b/lib/manager/cloudbuild/extract.spec.ts @@ -1,9 +1,9 @@ import { getName, loadFixture } from '../../../test/util'; import { extractPackageFile } from './extract'; -const file1 = loadFixture(__filename, 'cloudbuild.yml'); +const file1 = loadFixture('cloudbuild.yml'); -describe(getName(__filename), () => { +describe(getName(), () => { describe('extractPackageFile()', () => { it('returns null for empty', () => { expect(extractPackageFile('nothing here')).toBeNull(); diff --git a/lib/manager/cocoapods/extract.spec.ts b/lib/manager/cocoapods/extract.spec.ts index d8e5d18dcb3278..fc8e923e14478d 100644 --- a/lib/manager/cocoapods/extract.spec.ts +++ b/lib/manager/cocoapods/extract.spec.ts @@ -1,10 +1,10 @@ import { getName, loadFixture } from '../../../test/util'; import { extractPackageFile } from '.'; -const simplePodfile = loadFixture(__filename, 'Podfile.simple'); -const complexPodfile = loadFixture(__filename, 'Podfile.complex'); +const simplePodfile = loadFixture('Podfile.simple'); +const complexPodfile = loadFixture('Podfile.complex'); -describe(getName(__filename), () => { +describe(getName(), () => { describe('extractPackageFile()', () => { it('extracts all dependencies', async () => { const simpleResult = (await extractPackageFile(simplePodfile, 'Podfile')) diff --git a/lib/manager/composer/extract.spec.ts b/lib/manager/composer/extract.spec.ts index f7dc652ef6df87..b5d7a63259b5b9 100644 --- a/lib/manager/composer/extract.spec.ts +++ b/lib/manager/composer/extract.spec.ts @@ -3,14 +3,14 @@ import { extractPackageFile } from './extract'; jest.mock('../../util/fs'); -const requirements1 = loadFixture(__filename, 'composer1.json'); -const requirements2 = loadFixture(__filename, 'composer2.json'); -const requirements3 = loadFixture(__filename, 'composer3.json'); -const requirements4 = loadFixture(__filename, 'composer4.json'); -const requirements5 = loadFixture(__filename, 'composer5.json'); -const requirements5Lock = loadFixture(__filename, 'composer5.lock'); +const requirements1 = loadFixture('composer1.json'); +const requirements2 = loadFixture('composer2.json'); +const requirements3 = loadFixture('composer3.json'); +const requirements4 = loadFixture('composer4.json'); +const requirements5 = loadFixture('composer5.json'); +const requirements5Lock = loadFixture('composer5.lock'); -describe(getName(__filename), () => { +describe(getName(), () => { describe('extractPackageFile()', () => { let packageFile; beforeEach(() => { diff --git a/lib/manager/composer/utils.spec.ts b/lib/manager/composer/utils.spec.ts index 11dcd1fcbe2b45..824751e824f607 100644 --- a/lib/manager/composer/utils.spec.ts +++ b/lib/manager/composer/utils.spec.ts @@ -1,7 +1,7 @@ import { getName } from '../../../test/util'; import { extractContraints, getConstraint } from './utils'; -describe(getName(__filename), () => { +describe(getName(), () => { describe('getConstraint', () => { it('returns from config', () => { expect(getConstraint({ constraints: { composer: '1.1.0' } })).toEqual( diff --git a/lib/manager/deps-edn/extract.spec.ts b/lib/manager/deps-edn/extract.spec.ts index b240919bb75bdd..aff07a51f09e70 100644 --- a/lib/manager/deps-edn/extract.spec.ts +++ b/lib/manager/deps-edn/extract.spec.ts @@ -1,9 +1,9 @@ import { getName, loadFixture } from '../../../test/util'; import { extractPackageFile } from './extract'; -const depsEdn = loadFixture(__filename, 'deps.edn'); +const depsEdn = loadFixture('deps.edn'); -describe(getName(__filename), () => { +describe(getName(), () => { it('extractPackageFile', () => { expect(extractPackageFile(depsEdn)).toMatchSnapshot(); }); diff --git a/lib/manager/docker-compose/extract.spec.ts b/lib/manager/docker-compose/extract.spec.ts index 4cca8cd425415c..c1bbd0acfce457 100644 --- a/lib/manager/docker-compose/extract.spec.ts +++ b/lib/manager/docker-compose/extract.spec.ts @@ -1,14 +1,11 @@ import { getName, loadFixture } from '../../../test/util'; import { extractPackageFile } from './extract'; -const yamlFile1 = loadFixture(__filename, 'docker-compose.1.yml'); -const yamlFile3 = loadFixture(__filename, 'docker-compose.3.yml'); -const yamlFile3NoVersion = loadFixture( - __filename, - 'docker-compose.3-no-version.yml' -); +const yamlFile1 = loadFixture('docker-compose.1.yml'); +const yamlFile3 = loadFixture('docker-compose.3.yml'); +const yamlFile3NoVersion = loadFixture('docker-compose.3-no-version.yml'); -describe(getName(__filename), () => { +describe(getName(), () => { describe('extractPackageFile()', () => { it('returns null for empty', () => { expect(extractPackageFile('')).toBeNull(); diff --git a/lib/manager/dockerfile/extract.spec.ts b/lib/manager/dockerfile/extract.spec.ts index 6a72adff49ac56..d29581b87dc719 100644 --- a/lib/manager/dockerfile/extract.spec.ts +++ b/lib/manager/dockerfile/extract.spec.ts @@ -1,10 +1,10 @@ import { getName, loadFixture } from '../../../test/util'; import { extractPackageFile, getDep } from './extract'; -const d1 = loadFixture(__filename, '1.Dockerfile'); -const d2 = loadFixture(__filename, '2.Dockerfile'); +const d1 = loadFixture('1.Dockerfile'); +const d2 = loadFixture('2.Dockerfile'); -describe(getName(__filename), () => { +describe(getName(), () => { describe('extractPackageFile()', () => { it('handles no FROM', () => { const res = extractPackageFile('no from!'); diff --git a/lib/manager/droneci/extract.spec.ts b/lib/manager/droneci/extract.spec.ts index 3855871bb729f7..db090b49032583 100644 --- a/lib/manager/droneci/extract.spec.ts +++ b/lib/manager/droneci/extract.spec.ts @@ -2,9 +2,9 @@ import { getName, loadFixture } from '../../../test/util'; import { extractPackageFile } from './extract'; -const droneYAML = loadFixture(__filename, '.drone.yml'); +const droneYAML = loadFixture('.drone.yml'); -describe(getName(__filename), () => { +describe(getName(), () => { describe('extractPackageFile()', () => { it('returns null for empty', () => { expect(extractPackageFile('nothing here')).toBeNull(); diff --git a/lib/manager/git-submodules/artifact.spec.ts b/lib/manager/git-submodules/artifact.spec.ts index cdcf7103b30761..a4b3d771cf7bb6 100644 --- a/lib/manager/git-submodules/artifact.spec.ts +++ b/lib/manager/git-submodules/artifact.spec.ts @@ -1,7 +1,7 @@ import { getName } from '../../../test/util'; import updateArtifacts from './artifacts'; -describe(getName(__filename), () => { +describe(getName(), () => { describe('updateArtifacts()', () => { it('returns empty content', () => { expect( diff --git a/lib/manager/git-submodules/extract.spec.ts b/lib/manager/git-submodules/extract.spec.ts index cd83e813a8f604..2eabddfaa7953e 100644 --- a/lib/manager/git-submodules/extract.spec.ts +++ b/lib/manager/git-submodules/extract.spec.ts @@ -11,7 +11,7 @@ const Git: typeof _simpleGit = jest.requireActual('simple-git'); const localDir = `${__dirname}/__fixtures__`; -describe(getName(__filename), () => { +describe(getName(), () => { // flaky ci tests jest.setTimeout(10 * 1000); diff --git a/lib/manager/git-submodules/update.spec.ts b/lib/manager/git-submodules/update.spec.ts index 16634d3d945e70..4b239cead696d0 100644 --- a/lib/manager/git-submodules/update.spec.ts +++ b/lib/manager/git-submodules/update.spec.ts @@ -7,7 +7,7 @@ import updateDependency from './update'; jest.mock('simple-git'); const simpleGit: any = _simpleGit; -describe(getName(__filename), () => { +describe(getName(), () => { describe('updateDependency', () => { let upgrade: Upgrade; beforeAll(async () => { diff --git a/lib/manager/github-actions/extract.spec.ts b/lib/manager/github-actions/extract.spec.ts index 96b57906990614..35cbde7db19dc3 100644 --- a/lib/manager/github-actions/extract.spec.ts +++ b/lib/manager/github-actions/extract.spec.ts @@ -1,10 +1,10 @@ import { getName, loadFixture } from '../../../test/util'; import { extractPackageFile } from './extract'; -const workflow1 = loadFixture(__filename, 'workflow.yml.1'); -const workflow2 = loadFixture(__filename, 'workflow.yml.2'); +const workflow1 = loadFixture('workflow.yml.1'); +const workflow2 = loadFixture('workflow.yml.2'); -describe(getName(__filename), () => { +describe(getName(), () => { describe('extractPackageFile()', () => { it('returns null for empty', () => { expect(extractPackageFile('nothing here')).toBeNull(); diff --git a/lib/manager/gitlabci-include/extract.spec.ts b/lib/manager/gitlabci-include/extract.spec.ts index d0e561f84c941b..d4cb6fb9ecb45c 100644 --- a/lib/manager/gitlabci-include/extract.spec.ts +++ b/lib/manager/gitlabci-include/extract.spec.ts @@ -1,9 +1,9 @@ import { getName, loadFixture } from '../../../test/util'; import { extractPackageFile } from './extract'; -const yamlFile = loadFixture(__filename, 'gitlab-ci.1.yaml'); +const yamlFile = loadFixture('gitlab-ci.1.yaml'); -describe(getName(__filename), () => { +describe(getName(), () => { describe('extractPackageFile()', () => { it('returns null for empty', () => { expect( diff --git a/lib/manager/gitlabci/extract.spec.ts b/lib/manager/gitlabci/extract.spec.ts index 3ba33e00818424..1c624c5635148b 100644 --- a/lib/manager/gitlabci/extract.spec.ts +++ b/lib/manager/gitlabci/extract.spec.ts @@ -2,7 +2,7 @@ import { getName, logger } from '../../../test/util'; import type { PackageDependency } from '../types'; import { extractAllPackageFiles } from './extract'; -describe(getName(__filename), () => { +describe(getName(), () => { describe('extractAllPackageFiles()', () => { it('returns null for empty', async () => { expect( diff --git a/lib/manager/gomod/extract.spec.ts b/lib/manager/gomod/extract.spec.ts index e24ba7a50eee1a..d90cda8f521529 100644 --- a/lib/manager/gomod/extract.spec.ts +++ b/lib/manager/gomod/extract.spec.ts @@ -1,11 +1,11 @@ import { getName, loadFixture } from '../../../test/util'; import { extractPackageFile } from './extract'; -const gomod1 = loadFixture(__filename, '1/go.mod'); -const gomod2 = loadFixture(__filename, '2/go.mod'); -const gomod3 = loadFixture(__filename, '3/go.mod'); +const gomod1 = loadFixture('1/go.mod'); +const gomod2 = loadFixture('2/go.mod'); +const gomod3 = loadFixture('3/go.mod'); -describe(getName(__filename), () => { +describe(getName(), () => { describe('extractPackageFile()', () => { it('returns null for empty', () => { expect(extractPackageFile('nothing here')).toBeNull(); diff --git a/lib/manager/gomod/update.spec.ts b/lib/manager/gomod/update.spec.ts index eb03ca3cfc6806..7104f9c3882d24 100644 --- a/lib/manager/gomod/update.spec.ts +++ b/lib/manager/gomod/update.spec.ts @@ -2,10 +2,10 @@ import { getName, loadFixture } from '../../../test/util'; import type { UpdateType } from '../../config/types'; import { updateDependency } from './update'; -const gomod1 = loadFixture(__filename, '1/go.mod'); -const gomod2 = loadFixture(__filename, '2/go.mod'); +const gomod1 = loadFixture('1/go.mod'); +const gomod2 = loadFixture('2/go.mod'); -describe(getName(__filename), () => { +describe(getName(), () => { describe('updateDependency', () => { it('replaces existing value', () => { const upgrade = { diff --git a/lib/manager/gradle-lite/extract.spec.ts b/lib/manager/gradle-lite/extract.spec.ts index 0c4f37dcea9969..a5cb8fe2ef0a30 100644 --- a/lib/manager/gradle-lite/extract.spec.ts +++ b/lib/manager/gradle-lite/extract.spec.ts @@ -14,7 +14,7 @@ function mockFs(files: Record): void { ); } -describe(getName(__filename), () => { +describe(getName(), () => { beforeAll(() => {}); afterAll(() => { jest.resetAllMocks(); diff --git a/lib/manager/gradle-lite/parser.spec.ts b/lib/manager/gradle-lite/parser.spec.ts index 972653ff4bff10..b2edc5c09ffd67 100644 --- a/lib/manager/gradle-lite/parser.spec.ts +++ b/lib/manager/gradle-lite/parser.spec.ts @@ -2,7 +2,7 @@ import { getName, loadFixture } from '../../../test/util'; import { GOOGLE_REPO, JCENTER_REPO, MAVEN_REPO } from './common'; import { parseGradle, parseProps } from './parser'; -describe(getName(__filename), () => { +describe(getName(), () => { it('handles end of input', () => { expect(parseGradle('version = ').deps).toBeEmpty(); expect(parseGradle('id "foo.bar" version').deps).toBeEmpty(); @@ -156,11 +156,7 @@ describe(getName(__filename), () => { ]); }); it('parses fixture from "gradle" manager', () => { - const content = loadFixture( - __filename, - 'build.gradle.example1', - '../gradle' - ); + const content = loadFixture('build.gradle.example1', '../gradle'); const { deps } = parseGradle(content, {}, 'build.gradle'); deps.forEach((dep) => { expect( diff --git a/lib/manager/gradle-lite/tokenizer.spec.ts b/lib/manager/gradle-lite/tokenizer.spec.ts index 9376ddf3e5c8d5..d7378abdd1aa08 100644 --- a/lib/manager/gradle-lite/tokenizer.spec.ts +++ b/lib/manager/gradle-lite/tokenizer.spec.ts @@ -6,7 +6,7 @@ function tokenTypes(input): string[] { return extractRawTokens(input).map((token) => token.type); } -describe(getName(__filename), () => { +describe(getName(), () => { it('extractTokens', () => { const samples = { ' ': [TokenType.Space], diff --git a/lib/manager/gradle-lite/update.spec.ts b/lib/manager/gradle-lite/update.spec.ts index 44292e24d917e0..59a7371f9bc1e7 100644 --- a/lib/manager/gradle-lite/update.spec.ts +++ b/lib/manager/gradle-lite/update.spec.ts @@ -1,7 +1,7 @@ import { getName } from '../../../test/util'; import { updateDependency } from './update'; -describe(getName(__filename), () => { +describe(getName(), () => { it('replaces', () => { expect( updateDependency({ diff --git a/lib/manager/gradle-lite/utils.spec.ts b/lib/manager/gradle-lite/utils.spec.ts index fbd32eca74a760..6acce08828c3db 100644 --- a/lib/manager/gradle-lite/utils.spec.ts +++ b/lib/manager/gradle-lite/utils.spec.ts @@ -10,7 +10,7 @@ import { versionLikeSubstring, } from './utils'; -describe(getName(__filename), () => { +describe(getName(), () => { it('versionLikeSubstring', () => { [ '1.2.3', diff --git a/lib/manager/gradle-wrapper/artifacts-real.spec.ts b/lib/manager/gradle-wrapper/artifacts-real.spec.ts index 0d598a720cfabe..ce9af09d4c24ae 100644 --- a/lib/manager/gradle-wrapper/artifacts-real.spec.ts +++ b/lib/manager/gradle-wrapper/artifacts-real.spec.ts @@ -30,7 +30,7 @@ function compareFile(file: string, path: string) { ); } -describe(getName(__filename), () => { +describe(getName(), () => { ifSystemSupportsGradle(6).describe('real tests', () => { jest.setTimeout(60 * 1000); diff --git a/lib/manager/gradle-wrapper/artifacts.spec.ts b/lib/manager/gradle-wrapper/artifacts.spec.ts index 19dad4770cc7df..398d0b94ea3b39 100644 --- a/lib/manager/gradle-wrapper/artifacts.spec.ts +++ b/lib/manager/gradle-wrapper/artifacts.spec.ts @@ -38,7 +38,7 @@ function readString(...paths: string[]): Promise { return readFile(resolve(fixtures, ...paths), 'utf8'); } -describe(getName(__filename), () => { +describe(getName(), () => { beforeEach(async () => { jest.resetAllMocks(); httpMock.setup(); diff --git a/lib/manager/gradle-wrapper/extract.spec.ts b/lib/manager/gradle-wrapper/extract.spec.ts index f436ccdafdc953..d31fd4672355fa 100644 --- a/lib/manager/gradle-wrapper/extract.spec.ts +++ b/lib/manager/gradle-wrapper/extract.spec.ts @@ -1,16 +1,15 @@ import { getName, loadFixture } from '../../../test/util'; import { extractPackageFile } from './extract'; -const propertiesFile1 = loadFixture(__filename, 'gradle-wrapper-1.properties'); -const propertiesFile2 = loadFixture(__filename, 'gradle-wrapper-2.properties'); -const propertiesFile3 = loadFixture(__filename, 'gradle-wrapper-3.properties'); -const propertiesFile4 = loadFixture(__filename, 'gradle-wrapper-4.properties'); +const propertiesFile1 = loadFixture('gradle-wrapper-1.properties'); +const propertiesFile2 = loadFixture('gradle-wrapper-2.properties'); +const propertiesFile3 = loadFixture('gradle-wrapper-3.properties'); +const propertiesFile4 = loadFixture('gradle-wrapper-4.properties'); const whitespacePropertiesFile = loadFixture( - __filename, 'gradle-wrapper-whitespace.properties' ); -describe(getName(__filename), () => { +describe(getName(), () => { describe('extractPackageFile()', () => { it('returns null for empty', () => { expect(extractPackageFile('nothing here')).toBeNull(); diff --git a/lib/manager/gradle/build-gradle.spec.ts b/lib/manager/gradle/build-gradle.spec.ts index 04dc596088c252..e62f8a752e2db5 100644 --- a/lib/manager/gradle/build-gradle.spec.ts +++ b/lib/manager/gradle/build-gradle.spec.ts @@ -5,7 +5,7 @@ import { updateGradleVersion, } from './build-gradle'; -describe(getName(__filename), () => { +describe(getName(), () => { beforeEach(() => { init(); }); diff --git a/lib/manager/gradle/gradle-updates-report.spec.ts b/lib/manager/gradle/gradle-updates-report.spec.ts index ba318eaff5556e..39019792e9e518 100644 --- a/lib/manager/gradle/gradle-updates-report.spec.ts +++ b/lib/manager/gradle/gradle-updates-report.spec.ts @@ -13,7 +13,7 @@ import { GRADLE_DEPENDENCY_REPORT_OPTIONS } from '.'; const fixtures = 'lib/manager/gradle/__fixtures__'; -describe(getName(__filename), () => { +describe(getName(), () => { for (const gradleVersion of [5, 6]) { ifSystemSupportsGradle(gradleVersion).describe( 'createRenovateGradlePlugin', diff --git a/lib/manager/gradle/index-real.spec.ts b/lib/manager/gradle/index-real.spec.ts index 65f9a2e9b5f54b..5643b0c05199a1 100644 --- a/lib/manager/gradle/index-real.spec.ts +++ b/lib/manager/gradle/index-real.spec.ts @@ -13,7 +13,7 @@ const baseConfig = { }, }; -describe(getName(__filename), () => { +describe(getName(), () => { ifSystemSupportsGradle(6).describe('executeGradle integration', () => { const SUCCESS_FILE_NAME = 'success.indicator'; let workingDir: DirectoryResult; diff --git a/lib/manager/gradle/index.spec.ts b/lib/manager/gradle/index.spec.ts index 310ee8e73debe7..7acc18ec57b410 100644 --- a/lib/manager/gradle/index.spec.ts +++ b/lib/manager/gradle/index.spec.ts @@ -68,7 +68,7 @@ async function setupMocks() { return [require('.'), exec, util]; } -describe(getName(__filename), () => { +describe(getName(), () => { describe('extractPackageFile', () => { let manager: typeof _manager; let exec: jest.Mock; diff --git a/lib/manager/helm-requirements/extract.spec.ts b/lib/manager/helm-requirements/extract.spec.ts index b1dab0978dd0e8..f8e361c3321b49 100644 --- a/lib/manager/helm-requirements/extract.spec.ts +++ b/lib/manager/helm-requirements/extract.spec.ts @@ -4,7 +4,7 @@ import { extractPackageFile } from './extract'; jest.mock('../../util/fs'); -describe(getName(__filename), () => { +describe(getName(), () => { describe('extractPackageFile()', () => { beforeEach(() => { jest.resetAllMocks(); diff --git a/lib/manager/helm-values/extract.spec.ts b/lib/manager/helm-values/extract.spec.ts index 53fbc347837df3..93247b77d60001 100644 --- a/lib/manager/helm-values/extract.spec.ts +++ b/lib/manager/helm-values/extract.spec.ts @@ -2,16 +2,14 @@ import { getName, loadFixture } from '../../../test/util'; import { extractPackageFile } from './extract'; const helmDefaultChartInitValues = loadFixture( - __filename, 'default_chart_init_values.yaml' ); const helmMultiAndNestedImageValues = loadFixture( - __filename, 'multi_and_nested_image_values.yaml' ); -describe(getName(__filename), () => { +describe(getName(), () => { describe('extractPackageFile()', () => { beforeEach(() => { jest.resetAllMocks(); diff --git a/lib/manager/helmfile/extract.spec.ts b/lib/manager/helmfile/extract.spec.ts index 3a3888575aae4c..09b2a2290b9c58 100644 --- a/lib/manager/helmfile/extract.spec.ts +++ b/lib/manager/helmfile/extract.spec.ts @@ -1,9 +1,9 @@ import { getName, loadFixture } from '../../../test/util'; import { extractPackageFile } from './extract'; -const multidocYaml = loadFixture(__filename, 'multidoc.yaml'); +const multidocYaml = loadFixture('multidoc.yaml'); -describe(getName(__filename), () => { +describe(getName(), () => { describe('extractPackageFile()', () => { beforeEach(() => { jest.resetAllMocks(); diff --git a/lib/manager/helmv3/extract.spec.ts b/lib/manager/helmv3/extract.spec.ts index cb9fe5d1cd134b..2f95926d85da3a 100644 --- a/lib/manager/helmv3/extract.spec.ts +++ b/lib/manager/helmv3/extract.spec.ts @@ -3,7 +3,7 @@ import { extractPackageFile } from './extract'; jest.mock('../../util/fs'); -describe(getName(__filename), () => { +describe(getName(), () => { describe('extractPackageFile()', () => { beforeEach(() => { jest.resetAllMocks(); diff --git a/lib/manager/helmv3/update.spec.ts b/lib/manager/helmv3/update.spec.ts index a320378df0270b..ee49e109d43ab9 100644 --- a/lib/manager/helmv3/update.spec.ts +++ b/lib/manager/helmv3/update.spec.ts @@ -2,7 +2,7 @@ import yaml from 'js-yaml'; import { getName } from '../../../test/util'; import * as helmv3Updater from './update'; -describe(getName(__filename), () => { +describe(getName(), () => { describe('.bumpPackageVersion()', () => { const content = yaml.safeDump({ apiVersion: 'v2', diff --git a/lib/manager/homebrew/extract.spec.ts b/lib/manager/homebrew/extract.spec.ts index b4e8f6d8d87662..c26efaee4d2f24 100644 --- a/lib/manager/homebrew/extract.spec.ts +++ b/lib/manager/homebrew/extract.spec.ts @@ -1,13 +1,13 @@ import { getName, loadFixture } from '../../../test/util'; import { extractPackageFile } from './extract'; -const aalib = loadFixture(__filename, 'aalib.rb'); -const aap = loadFixture(__filename, 'aap.rb'); -const acmetool = loadFixture(__filename, 'acmetool.rb'); -const aide = loadFixture(__filename, 'aide.rb'); -const ibazel = loadFixture(__filename, 'ibazel.rb'); +const aalib = loadFixture('aalib.rb'); +const aap = loadFixture('aap.rb'); +const acmetool = loadFixture('acmetool.rb'); +const aide = loadFixture('aide.rb'); +const ibazel = loadFixture('ibazel.rb'); -describe(getName(__filename), () => { +describe(getName(), () => { describe('extractPackageFile()', () => { it('skips sourceforge dependency 1', () => { const res = extractPackageFile(aalib); diff --git a/lib/manager/homebrew/update.spec.ts b/lib/manager/homebrew/update.spec.ts index ad7f6df4a7ec8d..34f4fcc75a9d70 100644 --- a/lib/manager/homebrew/update.spec.ts +++ b/lib/manager/homebrew/update.spec.ts @@ -3,12 +3,12 @@ import * as httpMock from '../../../test/http-mock'; import { getName, loadFixture } from '../../../test/util'; import { updateDependency } from './update'; -const aide = loadFixture(__filename, 'aide.rb'); -const ibazel = loadFixture(__filename, 'ibazel.rb'); +const aide = loadFixture('aide.rb'); +const ibazel = loadFixture('ibazel.rb'); const baseUrl = 'https://github.com'; -describe(getName(__filename), () => { +describe(getName(), () => { beforeEach(() => { jest.resetAllMocks(); jest.resetModules(); diff --git a/lib/manager/homebrew/util.spec.ts b/lib/manager/homebrew/util.spec.ts index 1d72386416fe31..c29346a2f0c9fe 100644 --- a/lib/manager/homebrew/util.spec.ts +++ b/lib/manager/homebrew/util.spec.ts @@ -1,7 +1,7 @@ import { getName } from '../../../test/util'; import { skip } from './util'; -describe(getName(__filename), () => { +describe(getName(), () => { describe('skip()', () => { it('handles out of bounds case', () => { const content = 'some content'; diff --git a/lib/manager/html/extract.spec.ts b/lib/manager/html/extract.spec.ts index 20bfa9720bd4eb..c6aeeae6c2f95c 100644 --- a/lib/manager/html/extract.spec.ts +++ b/lib/manager/html/extract.spec.ts @@ -1,10 +1,10 @@ import { getName, loadFixture } from '../../../test/util'; import { extractPackageFile } from '.'; -const sample = loadFixture(__filename, `sample.html`); -const nothing = loadFixture(__filename, `nothing.html`); +const sample = loadFixture(`sample.html`); +const nothing = loadFixture(`nothing.html`); -describe(getName(__filename), () => { +describe(getName(), () => { it('extractPackageFile', () => { expect(extractPackageFile(sample)).toMatchSnapshot(); }); diff --git a/lib/manager/index.spec.ts b/lib/manager/index.spec.ts index 4b244f11b5122b..62ab0ab56499dc 100644 --- a/lib/manager/index.spec.ts +++ b/lib/manager/index.spec.ts @@ -3,7 +3,7 @@ import { loadModules } from '../util/modules'; import type { ManagerApi } from './types'; import * as manager from '.'; -describe(getName(__filename), () => { +describe(getName(), () => { describe('get()', () => { it('gets something', () => { expect(manager.get('dockerfile', 'extractPackageFile')).not.toBeNull(); diff --git a/lib/manager/jenkins/extract.spec.ts b/lib/manager/jenkins/extract.spec.ts index b9481d1576ec40..8163a935022cc2 100644 --- a/lib/manager/jenkins/extract.spec.ts +++ b/lib/manager/jenkins/extract.spec.ts @@ -1,15 +1,15 @@ import { getName, loadFixture } from '../../../test/util'; import { extractPackageFile } from './extract'; -const invalidYamlFile = loadFixture(__filename, 'invalid.yaml'); +const invalidYamlFile = loadFixture('invalid.yaml'); -const pluginsTextFile = loadFixture(__filename, 'plugins.txt'); -const pluginsYamlFile = loadFixture(__filename, 'plugins.yaml'); +const pluginsTextFile = loadFixture('plugins.txt'); +const pluginsYamlFile = loadFixture('plugins.yaml'); -const pluginsEmptyTextFile = loadFixture(__filename, 'empty.txt'); -const pluginsEmptyYamlFile = loadFixture(__filename, 'empty.yaml'); +const pluginsEmptyTextFile = loadFixture('empty.txt'); +const pluginsEmptyYamlFile = loadFixture('empty.yaml'); -describe(getName(__filename), () => { +describe(getName(), () => { describe('extractPackageFile()', () => { it('returns empty list for an empty text file', () => { const res = extractPackageFile(pluginsEmptyTextFile, 'path/file.txt'); diff --git a/lib/manager/kubernetes/extract.spec.ts b/lib/manager/kubernetes/extract.spec.ts index 04fe288e18c451..fa7f3b1f63a810 100644 --- a/lib/manager/kubernetes/extract.spec.ts +++ b/lib/manager/kubernetes/extract.spec.ts @@ -1,12 +1,12 @@ import { getName, loadFixture } from '../../../test/util'; import { extractPackageFile } from './extract'; -const kubernetesImagesFile = loadFixture(__filename, 'kubernetes.yaml'); -const kubernetesConfigMapFile = loadFixture(__filename, 'configmap.yaml'); -const kubernetesArraySyntaxFile = loadFixture(__filename, 'array-syntax.yaml'); -const otherYamlFile = loadFixture(__filename, 'gitlab-ci.yaml'); +const kubernetesImagesFile = loadFixture('kubernetes.yaml'); +const kubernetesConfigMapFile = loadFixture('configmap.yaml'); +const kubernetesArraySyntaxFile = loadFixture('array-syntax.yaml'); +const otherYamlFile = loadFixture('gitlab-ci.yaml'); -describe(getName(__filename), () => { +describe(getName(), () => { describe('extractPackageFile()', () => { it('returns null for empty', () => { expect(extractPackageFile(kubernetesConfigMapFile)).toBeNull(); diff --git a/lib/manager/kustomize/extract.spec.ts b/lib/manager/kustomize/extract.spec.ts index e4da4782aed016..beec2318373ad6 100644 --- a/lib/manager/kustomize/extract.spec.ts +++ b/lib/manager/kustomize/extract.spec.ts @@ -10,20 +10,17 @@ import { parseKustomize, } from './extract'; -const kustomizeGitSSHBase = loadFixture(__filename, 'gitSshBase.yaml'); -const kustomizeEmpty = loadFixture(__filename, 'kustomizeEmpty.yaml'); -const kustomizeGitSSHSubdir = loadFixture(__filename, 'gitSubdir.yaml'); -const kustomizeHTTP = loadFixture(__filename, 'kustomizeHttp.yaml'); -const kustomizeWithLocal = loadFixture(__filename, 'kustomizeWithLocal.yaml'); -const nonKustomize = loadFixture(__filename, 'service.yaml'); -const gitImages = loadFixture(__filename, 'gitImages.yaml'); -const kustomizeDepsInResources = loadFixture( - __filename, - 'depsInResources.yaml' -); -const sha = loadFixture(__filename, 'sha.yaml'); +const kustomizeGitSSHBase = loadFixture('gitSshBase.yaml'); +const kustomizeEmpty = loadFixture('kustomizeEmpty.yaml'); +const kustomizeGitSSHSubdir = loadFixture('gitSubdir.yaml'); +const kustomizeHTTP = loadFixture('kustomizeHttp.yaml'); +const kustomizeWithLocal = loadFixture('kustomizeWithLocal.yaml'); +const nonKustomize = loadFixture('service.yaml'); +const gitImages = loadFixture('gitImages.yaml'); +const kustomizeDepsInResources = loadFixture('depsInResources.yaml'); +const sha = loadFixture('sha.yaml'); -describe(getName(__filename), () => { +describe(getName(), () => { it('should successfully parse a valid kustomize file', () => { const file = parseKustomize(kustomizeGitSSHBase); expect(file).not.toBeNull(); diff --git a/lib/manager/leiningen/extract.spec.ts b/lib/manager/leiningen/extract.spec.ts index 681db83205e449..9dd83c4028a05a 100644 --- a/lib/manager/leiningen/extract.spec.ts +++ b/lib/manager/leiningen/extract.spec.ts @@ -2,9 +2,9 @@ import { getName, loadFixture } from '../../../test/util'; import * as datasourceClojure from '../../datasource/clojure'; import { extractFromVectors, extractPackageFile, trimAtKey } from './extract'; -const leinProjectClj = loadFixture(__filename, `project.clj`); +const leinProjectClj = loadFixture(`project.clj`); -describe(getName(__filename), () => { +describe(getName(), () => { it('trimAtKey', () => { expect(trimAtKey('foo', 'bar')).toBeNull(); expect(trimAtKey(':dependencies ', 'dependencies')).toBeNull(); diff --git a/lib/manager/maven/extract.spec.ts b/lib/manager/maven/extract.spec.ts index 36c443fe3faafd..2d439cb1c0f884 100644 --- a/lib/manager/maven/extract.spec.ts +++ b/lib/manager/maven/extract.spec.ts @@ -2,10 +2,10 @@ import { getName, loadFixture } from '../../../test/util'; import { extractPackage } from './extract'; -const minimumContent = loadFixture(__filename, `minimum.pom.xml`); -const simpleContent = loadFixture(__filename, `simple.pom.xml`); +const minimumContent = loadFixture(`minimum.pom.xml`); +const simpleContent = loadFixture(`simple.pom.xml`); -describe(getName(__filename), () => { +describe(getName(), () => { describe('extractDependencies', () => { it('returns null for invalid XML', () => { expect(extractPackage(undefined)).toBeNull(); diff --git a/lib/manager/maven/index.spec.ts b/lib/manager/maven/index.spec.ts index 4be69a337c6dbc..0bc2dddc2c1543 100644 --- a/lib/manager/maven/index.spec.ts +++ b/lib/manager/maven/index.spec.ts @@ -5,16 +5,16 @@ import { extractAllPackageFiles, updateDependency } from '.'; jest.mock('../../util/fs'); -const pomContent = loadFixture(__filename, 'simple.pom.xml'); -const pomParent = loadFixture(__filename, 'parent.pom.xml'); -const pomChild = loadFixture(__filename, 'child.pom.xml'); -const origContent = loadFixture(__filename, 'grouping.pom.xml'); +const pomContent = loadFixture('simple.pom.xml'); +const pomParent = loadFixture('parent.pom.xml'); +const pomChild = loadFixture('child.pom.xml'); +const origContent = loadFixture('grouping.pom.xml'); function selectDep(deps: PackageDependency[], name = 'org.example:quuz') { return deps.find((dep) => dep.depName === name); } -describe(getName(__filename), () => { +describe(getName(), () => { describe('extractAllPackageFiles', () => { it('should return empty if package has no content', async () => { fs.readLocalFile.mockResolvedValueOnce(null); diff --git a/lib/manager/meteor/extract.spec.ts b/lib/manager/meteor/extract.spec.ts index 7171f035823bc0..1af6bd74200368 100644 --- a/lib/manager/meteor/extract.spec.ts +++ b/lib/manager/meteor/extract.spec.ts @@ -1,9 +1,9 @@ import { getName, loadFixture } from '../../../test/util'; import { extractPackageFile } from './extract'; -const input01Content = loadFixture(__filename, 'package-1.js'); +const input01Content = loadFixture('package-1.js'); -describe(getName(__filename), () => { +describe(getName(), () => { describe('extractPackageFile()', () => { it('returns empty if fails to parse', () => { const res = extractPackageFile('blahhhhh:foo:@what\n'); diff --git a/lib/manager/mix/artifacts.spec.ts b/lib/manager/mix/artifacts.spec.ts index e1056f093817ea..84f1fa93f8db0f 100644 --- a/lib/manager/mix/artifacts.spec.ts +++ b/lib/manager/mix/artifacts.spec.ts @@ -15,7 +15,7 @@ const config = { localDir: join('/tmp/github/some/repo'), }; -describe(getName(__filename), () => { +describe(getName(), () => { beforeEach(async () => { jest.resetAllMocks(); jest.resetModules(); diff --git a/lib/manager/mix/extract.spec.ts b/lib/manager/mix/extract.spec.ts index 834c210a500389..4c3050b92ef45e 100644 --- a/lib/manager/mix/extract.spec.ts +++ b/lib/manager/mix/extract.spec.ts @@ -1,9 +1,9 @@ import { getName, loadFixture } from '../../../test/util'; import { extractPackageFile } from '.'; -const sample = loadFixture(__filename, 'mix.exs'); +const sample = loadFixture('mix.exs'); -describe(getName(__filename), () => { +describe(getName(), () => { describe('extractPackageFile()', () => { it('returns empty for invalid dependency file', async () => { expect( diff --git a/lib/manager/nodenv/extract.spec.ts b/lib/manager/nodenv/extract.spec.ts index 665338c56e228c..29127600c6b3c9 100644 --- a/lib/manager/nodenv/extract.spec.ts +++ b/lib/manager/nodenv/extract.spec.ts @@ -1,7 +1,7 @@ import { getName } from '../../../test/util'; import { extractPackageFile } from './extract'; -describe(getName(__filename), () => { +describe(getName(), () => { describe('extractPackageFile()', () => { it('returns a result', () => { const res = extractPackageFile('8.4.0\n'); diff --git a/lib/manager/npm/extract/index.spec.ts b/lib/manager/npm/extract/index.spec.ts index b4ea83e1ef2eda..1cffc3652c83c8 100644 --- a/lib/manager/npm/extract/index.spec.ts +++ b/lib/manager/npm/extract/index.spec.ts @@ -8,21 +8,16 @@ const fs: any = _fs; // TODO: fix types const defaultConfig = getConfig(); -const input01Content = loadFixture(__filename, 'inputs/01.json', '..'); -const workspacesContent = loadFixture( - __filename, - 'inputs/workspaces.json', - '..' -); +const input01Content = loadFixture('inputs/01.json', '..'); +const workspacesContent = loadFixture('inputs/workspaces.json', '..'); const workspacesSimpleContent = loadFixture( - __filename, 'inputs/workspaces-simple.json', '..' ); -const vendorisedContent = loadFixture(__filename, 'is-object.json', '..'); -const invalidNameContent = loadFixture(__filename, 'invalid-name.json', '..'); +const vendorisedContent = loadFixture('is-object.json', '..'); +const invalidNameContent = loadFixture('invalid-name.json', '..'); -describe(getName(__filename), () => { +describe(getName(), () => { describe('.extractPackageFile()', () => { beforeEach(() => { fs.readLocalFile = jest.fn(() => null); diff --git a/lib/manager/npm/extract/locked-versions.spec.ts b/lib/manager/npm/extract/locked-versions.spec.ts index 12bd02eed06cde..3adbbaa293843e 100644 --- a/lib/manager/npm/extract/locked-versions.spec.ts +++ b/lib/manager/npm/extract/locked-versions.spec.ts @@ -9,7 +9,7 @@ const yarn = require('./yarn'); jest.mock('./npm'); jest.mock('./yarn'); -describe(getName(__filename), () => { +describe(getName(), () => { describe('.getLockedVersions()', () => { it.each([['1.22.0'], ['2.1.0'], ['2.2.0']])( 'uses yarn.lock with yarn v%s', diff --git a/lib/manager/npm/extract/monorepo.spec.ts b/lib/manager/npm/extract/monorepo.spec.ts index 19e4f6cfe86bec..7290af4aa0f960 100644 --- a/lib/manager/npm/extract/monorepo.spec.ts +++ b/lib/manager/npm/extract/monorepo.spec.ts @@ -1,7 +1,7 @@ import { getName } from '../../../../test/util'; import { detectMonorepos } from './monorepo'; -describe(getName(__filename), () => { +describe(getName(), () => { describe('.extractPackageFile()', () => { it('uses lerna package settings', () => { const packageFiles = [ diff --git a/lib/manager/npm/extract/npm.spec.ts b/lib/manager/npm/extract/npm.spec.ts index 1946d3e61eb9b8..14f37a68d5e315 100644 --- a/lib/manager/npm/extract/npm.spec.ts +++ b/lib/manager/npm/extract/npm.spec.ts @@ -3,7 +3,7 @@ import { getNpmLock } from './npm'; jest.mock('../../../util/fs'); -describe(getName(__filename), () => { +describe(getName(), () => { describe('.getNpmLock()', () => { it('returns empty if failed to parse', async () => { fs.readLocalFile.mockResolvedValueOnce('abcd'); @@ -11,18 +11,14 @@ describe(getName(__filename), () => { expect(Object.keys(res.lockedVersions)).toHaveLength(0); }); it('extracts', async () => { - const plocktest1Lock = loadFixture( - __filename, - 'plocktest1/package-lock.json', - '..' - ); + const plocktest1Lock = loadFixture('plocktest1/package-lock.json', '..'); fs.readLocalFile.mockResolvedValueOnce(plocktest1Lock as never); const res = await getNpmLock('package.json'); expect(res).toMatchSnapshot(); expect(Object.keys(res.lockedVersions)).toHaveLength(7); }); it('extracts npm 7 lockfile', async () => { - const npm7Lock = loadFixture(__filename, 'npm7/package-lock.json', '..'); + const npm7Lock = loadFixture('npm7/package-lock.json', '..'); fs.readLocalFile.mockResolvedValueOnce(npm7Lock as never); const res = await getNpmLock('package.json'); expect(res).toMatchSnapshot(); diff --git a/lib/manager/npm/extract/type.spec.ts b/lib/manager/npm/extract/type.spec.ts index 371a7a40f8efa7..21cc35562b704a 100644 --- a/lib/manager/npm/extract/type.spec.ts +++ b/lib/manager/npm/extract/type.spec.ts @@ -1,7 +1,7 @@ import { getName } from '../../../../test/util'; import { mightBeABrowserLibrary } from './type'; -describe(getName(__filename), () => { +describe(getName(), () => { describe('.mightBeABrowserLibrary()', () => { it('is not a library if private', () => { const isLibrary = mightBeABrowserLibrary({ private: true }); diff --git a/lib/manager/npm/extract/yarn.spec.ts b/lib/manager/npm/extract/yarn.spec.ts index 9882b371471882..4a8ad30f8677dc 100644 --- a/lib/manager/npm/extract/yarn.spec.ts +++ b/lib/manager/npm/extract/yarn.spec.ts @@ -3,7 +3,7 @@ import { getYarnLock } from './yarn'; jest.mock('../../../util/fs'); -describe(getName(__filename), () => { +describe(getName(), () => { describe('.getYarnLock()', () => { it('returns empty if exception parsing', async () => { fs.readLocalFile.mockResolvedValueOnce('abcd'); @@ -13,11 +13,7 @@ describe(getName(__filename), () => { }); it('extracts yarn 1', async () => { - const plocktest1Lock = loadFixture( - __filename, - 'plocktest1/yarn.lock', - '..' - ); + const plocktest1Lock = loadFixture('plocktest1/yarn.lock', '..'); fs.readLocalFile.mockResolvedValueOnce(plocktest1Lock); const res = await getYarnLock('package.json'); expect(res.isYarn1).toBe(true); @@ -27,7 +23,7 @@ describe(getName(__filename), () => { }); it('extracts yarn 2', async () => { - const plocktest1Lock = loadFixture(__filename, 'yarn2/yarn.lock', '..'); + const plocktest1Lock = loadFixture('yarn2/yarn.lock', '..'); fs.readLocalFile.mockResolvedValueOnce(plocktest1Lock); const res = await getYarnLock('package.json'); expect(res.isYarn1).toBe(false); @@ -37,7 +33,7 @@ describe(getName(__filename), () => { }); it('extracts yarn 2 cache version', async () => { - const plocktest1Lock = loadFixture(__filename, 'yarn2.2/yarn.lock', '..'); + const plocktest1Lock = loadFixture('yarn2.2/yarn.lock', '..'); fs.readLocalFile.mockResolvedValueOnce(plocktest1Lock); const res = await getYarnLock('package.json'); expect(res.isYarn1).toBe(false); diff --git a/lib/manager/npm/post-update/lerna.spec.ts b/lib/manager/npm/post-update/lerna.spec.ts index 267bef2c31d306..329acac7c9ab18 100644 --- a/lib/manager/npm/post-update/lerna.spec.ts +++ b/lib/manager/npm/post-update/lerna.spec.ts @@ -25,7 +25,7 @@ function lernaPkgFileWithoutLernaDep(lernaClient: string) { lernaClient, }; } -describe(getName(__filename), () => { +describe(getName(), () => { describe('generateLockFiles()', () => { beforeEach(() => { jest.resetAllMocks(); diff --git a/lib/manager/npm/post-update/yarn.spec.ts b/lib/manager/npm/post-update/yarn.spec.ts index 84173a6d8232a8..1455157eb9482f 100644 --- a/lib/manager/npm/post-update/yarn.spec.ts +++ b/lib/manager/npm/post-update/yarn.spec.ts @@ -26,7 +26,7 @@ const fixSnapshots = (snapshots: ExecSnapshots): ExecSnapshots => cmd: snapshot.cmd.replace(/^.*\/yarn.*?\.js\s+/, ' '), })); -describe(getName(__filename), () => { +describe(getName(), () => { beforeEach(() => { jest.resetAllMocks(); jest.resetModules(); diff --git a/lib/manager/npm/update/dependency/index.spec.ts b/lib/manager/npm/update/dependency/index.spec.ts index b2a2c177b3a483..0953246103108b 100644 --- a/lib/manager/npm/update/dependency/index.spec.ts +++ b/lib/manager/npm/update/dependency/index.spec.ts @@ -1,12 +1,12 @@ import { getName, loadFixture } from '../../../../../test/util'; import * as npmUpdater from '.'; -const readFixture = (x: string): string => loadFixture(__filename, x, '../..'); +const readFixture = (x: string): string => loadFixture(x, '../..'); const input01Content = readFixture('inputs/01.json'); const input01GlobContent = readFixture('inputs/01-glob.json'); -describe(getName(__filename), () => { +describe(getName(), () => { describe('.updateDependency(fileContent, depType, depName, newValue)', () => { it('replaces a dependency value', () => { const upgrade = { diff --git a/lib/manager/npm/update/locked-dependency/dep-constraints.spec.ts b/lib/manager/npm/update/locked-dependency/dep-constraints.spec.ts index 577b9317221bf9..1cd594f0ff2db5 100644 --- a/lib/manager/npm/update/locked-dependency/dep-constraints.spec.ts +++ b/lib/manager/npm/update/locked-dependency/dep-constraints.spec.ts @@ -3,10 +3,10 @@ import { findDepConstraints } from './dep-constraints'; jest.mock('../../../../util/fs'); -const packageJson = loadJsonFixture(__filename, 'package.json'); -const packageLockJson = loadJsonFixture(__filename, 'package-lock.json'); +const packageJson = loadJsonFixture('package.json'); +const packageLockJson = loadJsonFixture('package-lock.json'); -describe(getName(__filename), () => { +describe(getName(), () => { describe('findDepConstraints()', () => { it('finds indirect dependency', () => { expect( diff --git a/lib/manager/npm/update/locked-dependency/get-locked.spec.ts b/lib/manager/npm/update/locked-dependency/get-locked.spec.ts index 80370af9e543ac..07c96bb5cb9f75 100644 --- a/lib/manager/npm/update/locked-dependency/get-locked.spec.ts +++ b/lib/manager/npm/update/locked-dependency/get-locked.spec.ts @@ -3,9 +3,9 @@ import { getLockedDependencies } from './get-locked'; jest.mock('../../../../util/fs'); -const packageLockJson = loadJsonFixture(__filename, 'package-lock.json'); +const packageLockJson = loadJsonFixture('package-lock.json'); -describe(getName(__filename), () => { +describe(getName(), () => { describe('getLockedDependencies()', () => { it('handles error', () => { expect(getLockedDependencies(null as any, 'some-dep', '1.0.0')).toEqual( diff --git a/lib/manager/npm/update/locked-dependency/index.spec.ts b/lib/manager/npm/update/locked-dependency/index.spec.ts index ebcda222783838..8b63d485f0b30c 100644 --- a/lib/manager/npm/update/locked-dependency/index.spec.ts +++ b/lib/manager/npm/update/locked-dependency/index.spec.ts @@ -4,18 +4,16 @@ import { clone } from '../../../../util/clone'; import type { UpdateLockedConfig } from '../../../types'; import { updateLockedDependency } from '.'; -const packageFileContent = loadFixture(__filename, 'package.json'); -const lockFileContent = loadFixture(__filename, 'package-lock.json'); -const acceptsJson = JSON.parse(loadFixture(__filename, 'accepts.json')); -const expressJson = JSON.parse(loadFixture(__filename, 'express.json')); -const mimeJson = JSON.parse(loadFixture(__filename, 'mime.json')); -const serveStaticJson = JSON.parse( - loadFixture(__filename, 'serve-static.json') -); -const sendJson = JSON.parse(loadFixture(__filename, 'send.json')); -const typeIsJson = JSON.parse(loadFixture(__filename, 'type-is.json')); +const packageFileContent = loadFixture('package.json'); +const lockFileContent = loadFixture('package-lock.json'); +const acceptsJson = JSON.parse(loadFixture('accepts.json')); +const expressJson = JSON.parse(loadFixture('express.json')); +const mimeJson = JSON.parse(loadFixture('mime.json')); +const serveStaticJson = JSON.parse(loadFixture('serve-static.json')); +const sendJson = JSON.parse(loadFixture('send.json')); +const typeIsJson = JSON.parse(loadFixture('type-is.json')); -describe(getName(__filename), () => { +describe(getName(), () => { describe('updateLockedDependency()', () => { let config: UpdateLockedConfig; beforeEach(() => { diff --git a/lib/manager/npm/update/locked-dependency/parent-version.spec.ts b/lib/manager/npm/update/locked-dependency/parent-version.spec.ts index 0e5717c181a216..0415965d1b324e 100644 --- a/lib/manager/npm/update/locked-dependency/parent-version.spec.ts +++ b/lib/manager/npm/update/locked-dependency/parent-version.spec.ts @@ -2,9 +2,9 @@ import * as httpMock from '../../../../../test/http-mock'; import { getName, loadJsonFixture } from '../../../../../test/util'; import { findFirstParentVersion } from './parent-version'; -const expressJson = loadJsonFixture(__filename, 'express.json'); +const expressJson = loadJsonFixture('express.json'); -describe(getName(__filename), () => { +describe(getName(), () => { describe('getLockedDependencies()', () => { beforeEach(() => { httpMock.setup(); diff --git a/lib/manager/npm/update/package-version/index.spec.ts b/lib/manager/npm/update/package-version/index.spec.ts index 9164c8f85a2504..6df6e27549e979 100644 --- a/lib/manager/npm/update/package-version/index.spec.ts +++ b/lib/manager/npm/update/package-version/index.spec.ts @@ -1,7 +1,7 @@ import { getName } from '../../../../../test/util'; import * as npmUpdater from '.'; -describe(getName(__filename), () => { +describe(getName(), () => { describe('.bumpPackageVersion()', () => { const content = JSON.stringify({ name: 'some-package', diff --git a/lib/manager/nuget/extract.spec.ts b/lib/manager/nuget/extract.spec.ts index 74494f376480ca..532b9e61dede9a 100644 --- a/lib/manager/nuget/extract.spec.ts +++ b/lib/manager/nuget/extract.spec.ts @@ -4,7 +4,7 @@ import { getName } from '../../../test/util'; import type { ExtractConfig } from '../types'; import { extractPackageFile } from './extract'; -describe(getName(__filename), () => { +describe(getName(), () => { describe('extractPackageFile()', () => { let config: ExtractConfig; beforeEach(() => { diff --git a/lib/manager/nvm/extract.spec.ts b/lib/manager/nvm/extract.spec.ts index 665338c56e228c..29127600c6b3c9 100644 --- a/lib/manager/nvm/extract.spec.ts +++ b/lib/manager/nvm/extract.spec.ts @@ -1,7 +1,7 @@ import { getName } from '../../../test/util'; import { extractPackageFile } from './extract'; -describe(getName(__filename), () => { +describe(getName(), () => { describe('extractPackageFile()', () => { it('returns a result', () => { const res = extractPackageFile('8.4.0\n'); diff --git a/lib/manager/pip_requirements/extract.spec.ts b/lib/manager/pip_requirements/extract.spec.ts index 886f6059fe10c0..259455bb1fa3d1 100644 --- a/lib/manager/pip_requirements/extract.spec.ts +++ b/lib/manager/pip_requirements/extract.spec.ts @@ -2,15 +2,15 @@ import { getName, loadFixture } from '../../../test/util'; import { setAdminConfig } from '../../config/admin'; import { extractPackageFile } from './extract'; -const requirements1 = loadFixture(__filename, 'requirements1.txt'); -const requirements2 = loadFixture(__filename, 'requirements2.txt'); -const requirements3 = loadFixture(__filename, 'requirements3.txt'); -const requirements4 = loadFixture(__filename, 'requirements4.txt'); -const requirements5 = loadFixture(__filename, 'requirements5.txt'); -const requirements6 = loadFixture(__filename, 'requirements6.txt'); -const requirements7 = loadFixture(__filename, 'requirements7.txt'); +const requirements1 = loadFixture('requirements1.txt'); +const requirements2 = loadFixture('requirements2.txt'); +const requirements3 = loadFixture('requirements3.txt'); +const requirements4 = loadFixture('requirements4.txt'); +const requirements5 = loadFixture('requirements5.txt'); +const requirements6 = loadFixture('requirements6.txt'); +const requirements7 = loadFixture('requirements7.txt'); -describe(getName(__filename), () => { +describe(getName(), () => { beforeEach(() => { delete process.env.PIP_TEST_TOKEN; setAdminConfig(); diff --git a/lib/manager/pip_setup/extract.spec.ts b/lib/manager/pip_setup/extract.spec.ts index daee26c623f7a7..cf8d187a70bbf2 100644 --- a/lib/manager/pip_setup/extract.spec.ts +++ b/lib/manager/pip_setup/extract.spec.ts @@ -10,7 +10,7 @@ import { jest.mock('child_process'); jest.mock('../../util/exec/env'); -describe(getName(__filename), () => { +describe(getName(), () => { beforeEach(() => { jest.resetAllMocks(); jest.resetModules(); diff --git a/lib/manager/pip_setup/index.spec.ts b/lib/manager/pip_setup/index.spec.ts index b81802bc82f6be..82095fcb2bc2dd 100644 --- a/lib/manager/pip_setup/index.spec.ts +++ b/lib/manager/pip_setup/index.spec.ts @@ -13,8 +13,8 @@ import * as extract from './extract'; import { extractPackageFile } from '.'; const packageFile = 'setup.py'; -const content = loadFixture(__filename, packageFile); -const jsonContent = loadFixture(__filename, 'setup.py.json'); +const content = loadFixture(packageFile); +const jsonContent = loadFixture('setup.py.json'); const config = { localDir: '/tmp/github/some/repo', @@ -36,7 +36,7 @@ const fixSnapshots = (snapshots: ExecSnapshots): ExecSnapshots => cmd: snapshot.cmd.replace(/^.*extract\.py"\s+/, ' '), })); -describe(getName(__filename), () => { +describe(getName(), () => { describe('extractPackageFile()', () => { beforeEach(async () => { jest.resetAllMocks(); diff --git a/lib/manager/pipenv/extract.spec.ts b/lib/manager/pipenv/extract.spec.ts index d302208b924b43..538f8637b8e214 100644 --- a/lib/manager/pipenv/extract.spec.ts +++ b/lib/manager/pipenv/extract.spec.ts @@ -3,13 +3,13 @@ import { extractPackageFile } from './extract'; jest.mock('../../util/fs'); -const pipfile1 = loadFixture(__filename, 'Pipfile1'); -const pipfile2 = loadFixture(__filename, 'Pipfile2'); -const pipfile3 = loadFixture(__filename, 'Pipfile3'); -const pipfile4 = loadFixture(__filename, 'Pipfile4'); -const pipfile5 = loadFixture(__filename, 'Pipfile5'); +const pipfile1 = loadFixture('Pipfile1'); +const pipfile2 = loadFixture('Pipfile2'); +const pipfile3 = loadFixture('Pipfile3'); +const pipfile4 = loadFixture('Pipfile4'); +const pipfile5 = loadFixture('Pipfile5'); -describe(getName(__filename), () => { +describe(getName(), () => { describe('extractPackageFile()', () => { it('returns null for empty', async () => { expect(await extractPackageFile('[packages]\r\n', 'Pipfile')).toBeNull(); diff --git a/lib/manager/poetry/artifacts.spec.ts b/lib/manager/poetry/artifacts.spec.ts index 92466cf6aae69b..52289eb2935b3e 100644 --- a/lib/manager/poetry/artifacts.spec.ts +++ b/lib/manager/poetry/artifacts.spec.ts @@ -11,7 +11,7 @@ import * as _env from '../../util/exec/env'; import * as _hostRules from '../../util/host-rules'; import { updateArtifacts } from './artifacts'; -const pyproject10toml = loadFixture(__filename, 'pyproject.10.toml'); +const pyproject10toml = loadFixture('pyproject.10.toml'); jest.mock('fs-extra'); jest.mock('child_process'); @@ -209,7 +209,7 @@ describe('.updateArtifacts()', () => { newPackageFileContent: '{}', config: { ...config, - isLockFileMaintenance: true, + updateType: 'lockFileMaintenance', }, }) ).not.toBeNull(); diff --git a/lib/manager/poetry/artifacts.ts b/lib/manager/poetry/artifacts.ts index 00b39d1b4407fa..9d4bba5551d040 100644 --- a/lib/manager/poetry/artifacts.ts +++ b/lib/manager/poetry/artifacts.ts @@ -91,7 +91,9 @@ export async function updateArtifacts({ config, }: UpdateArtifact): Promise { logger.debug(`poetry.updateArtifacts(${packageFileName})`); - if (!is.nonEmptyArray(updatedDeps) && !config.isLockFileMaintenance) { + const isLockFileMaintenance = config.updateType === 'lockFileMaintenance'; + + if (!is.nonEmptyArray(updatedDeps) && !isLockFileMaintenance) { logger.debug('No updated poetry deps - returning null'); return null; } @@ -111,7 +113,7 @@ export async function updateArtifacts({ try { await writeLocalFile(packageFileName, newPackageFileContent); const cmd: string[] = []; - if (config.isLockFileMaintenance) { + if (isLockFileMaintenance) { await deleteLocalFile(lockFileName); cmd.push('poetry update --lock --no-interaction'); } else { diff --git a/lib/manager/poetry/extract.spec.ts b/lib/manager/poetry/extract.spec.ts index 5991b47a68fd3d..5a9a46e050248b 100644 --- a/lib/manager/poetry/extract.spec.ts +++ b/lib/manager/poetry/extract.spec.ts @@ -3,21 +3,21 @@ import { extractPackageFile } from './extract'; jest.mock('../../util/fs'); -const pyproject1toml = loadFixture(__filename, 'pyproject.1.toml'); -const pyproject2toml = loadFixture(__filename, 'pyproject.2.toml'); -const pyproject3toml = loadFixture(__filename, 'pyproject.3.toml'); -const pyproject4toml = loadFixture(__filename, 'pyproject.4.toml'); -const pyproject5toml = loadFixture(__filename, 'pyproject.5.toml'); -const pyproject6toml = loadFixture(__filename, 'pyproject.6.toml'); -const pyproject7toml = loadFixture(__filename, 'pyproject.7.toml'); -const pyproject8toml = loadFixture(__filename, 'pyproject.8.toml'); -const pyproject9toml = loadFixture(__filename, 'pyproject.9.toml'); +const pyproject1toml = loadFixture('pyproject.1.toml'); +const pyproject2toml = loadFixture('pyproject.2.toml'); +const pyproject3toml = loadFixture('pyproject.3.toml'); +const pyproject4toml = loadFixture('pyproject.4.toml'); +const pyproject5toml = loadFixture('pyproject.5.toml'); +const pyproject6toml = loadFixture('pyproject.6.toml'); +const pyproject7toml = loadFixture('pyproject.7.toml'); +const pyproject8toml = loadFixture('pyproject.8.toml'); +const pyproject9toml = loadFixture('pyproject.9.toml'); // pyproject.10.toml use by artifacts -const pyproject11toml = loadFixture(__filename, 'pyproject.11.toml'); -const pyproject11tomlLock = loadFixture(__filename, 'pyproject.11.toml.lock'); +const pyproject11toml = loadFixture('pyproject.11.toml'); +const pyproject11tomlLock = loadFixture('pyproject.11.toml.lock'); -describe(getName(__filename), () => { +describe(getName(), () => { describe('extractPackageFile()', () => { let filename: string; const OLD_ENV = process.env; diff --git a/lib/manager/pre-commit/extract.spec.ts b/lib/manager/pre-commit/extract.spec.ts index fd9ae0b6c53e40..84fe1aaafd1429 100644 --- a/lib/manager/pre-commit/extract.spec.ts +++ b/lib/manager/pre-commit/extract.spec.ts @@ -6,32 +6,20 @@ jest.mock('../../util/host-rules'); const hostRules = mocked(_hostRules); const filename = '.pre-commit.yaml'; -const complexPrecommitConfig = loadFixture( - __filename, - 'complex.pre-commit-config.yaml' -); -const examplePrecommitConfig = loadFixture( - __filename, - '.pre-commit-config.yaml' -); +const complexPrecommitConfig = loadFixture('complex.pre-commit-config.yaml'); +const examplePrecommitConfig = loadFixture('.pre-commit-config.yaml'); const emptyReposPrecommitConfig = loadFixture( - __filename, 'empty_repos.pre-commit-config.yaml' ); -const noReposPrecommitConfig = loadFixture( - __filename, - 'no_repos.pre-commit-config.yaml' -); +const noReposPrecommitConfig = loadFixture('no_repos.pre-commit-config.yaml'); const invalidRepoPrecommitConfig = loadFixture( - __filename, 'invalid_repo.pre-commit-config.yaml' ); const enterpriseGitPrecommitConfig = loadFixture( - __filename, 'enterprise.pre-commit-config.yaml' ); -describe(getName(__filename), () => { +describe(getName(), () => { describe('extractPackageFile()', () => { beforeEach(() => { jest.resetAllMocks(); diff --git a/lib/manager/pub/extract.spec.ts b/lib/manager/pub/extract.spec.ts index 1b5c74a5d6c203..2ed9691dd05b70 100644 --- a/lib/manager/pub/extract.spec.ts +++ b/lib/manager/pub/extract.spec.ts @@ -1,10 +1,10 @@ import { getName, loadFixture } from '../../../test/util'; import { extractPackageFile } from '.'; -const brokenYaml = loadFixture(__filename, 'update.yaml'); -const packageFile = loadFixture(__filename, 'extract.yaml'); +const brokenYaml = loadFixture('update.yaml'); +const packageFile = loadFixture('extract.yaml'); -describe(getName(__filename), () => { +describe(getName(), () => { describe('extractPackageFile', () => { it('should return null if package does not contain any deps', () => { const res = extractPackageFile('foo: bar', 'pubspec.yaml'); diff --git a/lib/manager/regex/index.spec.ts b/lib/manager/regex/index.spec.ts index 0f944b63a9f877..30a45786ebcc1e 100644 --- a/lib/manager/regex/index.spec.ts +++ b/lib/manager/regex/index.spec.ts @@ -3,11 +3,11 @@ import { logger } from '../../logger'; import type { CustomExtractConfig } from '../types'; import { defaultConfig, extractPackageFile } from '.'; -const dockerfileContent = loadFixture(__filename, `Dockerfile`); -const ansibleYamlContent = loadFixture(__filename, `ansible.yml`); -const exampleJsonContent = loadFixture(__filename, `example.json`); +const dockerfileContent = loadFixture(`Dockerfile`); +const ansibleYamlContent = loadFixture(`ansible.yml`); +const exampleJsonContent = loadFixture(`example.json`); -describe(getName(__filename), () => { +describe(getName(), () => { it('has default config', () => { expect(defaultConfig).toEqual({ pinDigests: false, diff --git a/lib/manager/ruby-version/extract.spec.ts b/lib/manager/ruby-version/extract.spec.ts index 665338c56e228c..29127600c6b3c9 100644 --- a/lib/manager/ruby-version/extract.spec.ts +++ b/lib/manager/ruby-version/extract.spec.ts @@ -1,7 +1,7 @@ import { getName } from '../../../test/util'; import { extractPackageFile } from './extract'; -describe(getName(__filename), () => { +describe(getName(), () => { describe('extractPackageFile()', () => { it('returns a result', () => { const res = extractPackageFile('8.4.0\n'); diff --git a/lib/manager/sbt/extract.spec.ts b/lib/manager/sbt/extract.spec.ts index 9ddb9831332636..8e4068f06c0b1f 100644 --- a/lib/manager/sbt/extract.spec.ts +++ b/lib/manager/sbt/extract.spec.ts @@ -1,22 +1,15 @@ import { getName, loadFixture } from '../../../test/util'; import { extractPackageFile } from './extract'; -const sbt = loadFixture(__filename, `sample.sbt`); -const sbtScalaVersionVariable = loadFixture( - __filename, - `scala-version-variable.sbt` -); -const sbtMissingScalaVersion = loadFixture( - __filename, - `missing-scala-version.sbt` -); -const sbtDependencyFile = loadFixture(__filename, `dependency-file.scala`); +const sbt = loadFixture(`sample.sbt`); +const sbtScalaVersionVariable = loadFixture(`scala-version-variable.sbt`); +const sbtMissingScalaVersion = loadFixture(`missing-scala-version.sbt`); +const sbtDependencyFile = loadFixture(`dependency-file.scala`); const sbtPrivateVariableDependencyFile = loadFixture( - __filename, `private-variable-dependency-file.scala` ); -describe(getName(__filename), () => { +describe(getName(), () => { describe('extractPackageFile()', () => { it('returns null for empty', () => { expect(extractPackageFile(null)).toBeNull(); diff --git a/lib/manager/sbt/update.spec.ts b/lib/manager/sbt/update.spec.ts index 180947f91b2dc6..33d5fa8277654f 100644 --- a/lib/manager/sbt/update.spec.ts +++ b/lib/manager/sbt/update.spec.ts @@ -1,7 +1,7 @@ import { getName } from '../../../test/util'; import * as sbtUpdater from './update'; -describe(getName(__filename), () => { +describe(getName(), () => { describe('.bumpPackageVersion()', () => { const content = 'name := "test"\n' + diff --git a/lib/manager/setup-cfg/extract.spec.ts b/lib/manager/setup-cfg/extract.spec.ts index 693c3d6d0be9dc..a0a6d545102b8d 100644 --- a/lib/manager/setup-cfg/extract.spec.ts +++ b/lib/manager/setup-cfg/extract.spec.ts @@ -1,9 +1,9 @@ import { getName, loadFixture } from '../../../test/util'; import { extractPackageFile } from './extract'; -const content = loadFixture(__filename, 'setup-cfg-1.txt'); +const content = loadFixture('setup-cfg-1.txt'); -describe(getName(__filename), () => { +describe(getName(), () => { describe('extractPackageFile()', () => { it('returns null for empty', () => { expect(extractPackageFile('nothing here')).toBeNull(); diff --git a/lib/manager/swift/index.spec.ts b/lib/manager/swift/index.spec.ts index 3c0e90918502ad..dc49b58eacdbee 100644 --- a/lib/manager/swift/index.spec.ts +++ b/lib/manager/swift/index.spec.ts @@ -1,9 +1,9 @@ import { getName, loadFixture } from '../../../test/util'; import { extractPackageFile } from './extract'; -const pkgContent = loadFixture(__filename, `SamplePackage.swift`); +const pkgContent = loadFixture(`SamplePackage.swift`); -describe(getName(__filename), () => { +describe(getName(), () => { describe('extractPackageFile()', () => { it('returns null for empty content', () => { expect(extractPackageFile(null)).toBeNull(); diff --git a/lib/manager/terraform-version/extract.spec.ts b/lib/manager/terraform-version/extract.spec.ts index 9cab89edb6d455..f310cd38b6c3ab 100644 --- a/lib/manager/terraform-version/extract.spec.ts +++ b/lib/manager/terraform-version/extract.spec.ts @@ -1,7 +1,7 @@ import { getName } from '../../../test/util'; import { extractPackageFile } from './extract'; -describe(getName(__filename), () => { +describe(getName(), () => { describe('extractPackageFile()', () => { it('returns a result', () => { const res = extractPackageFile('12.0.0\n'); diff --git a/lib/manager/terraform/extract.spec.ts b/lib/manager/terraform/extract.spec.ts index b617c39b856374..a8b06a6ee5db41 100644 --- a/lib/manager/terraform/extract.spec.ts +++ b/lib/manager/terraform/extract.spec.ts @@ -1,14 +1,14 @@ import { getName, loadFixture } from '../../../test/util'; import { extractPackageFile } from './extract'; -const tf1 = loadFixture(__filename, '1.tf'); +const tf1 = loadFixture('1.tf'); const tf2 = `module "relative" { source = "../../modules/fe" } `; -const helm = loadFixture(__filename, 'helm.tf'); +const helm = loadFixture('helm.tf'); -describe(getName(__filename), () => { +describe(getName(), () => { describe('extractPackageFile()', () => { it('returns null for empty', () => { expect(extractPackageFile('nothing here')).toBeNull(); diff --git a/lib/manager/terraform/modules.spec.ts b/lib/manager/terraform/modules.spec.ts index 2dcf3a594f8c3c..fe85fdaedda699 100644 --- a/lib/manager/terraform/modules.spec.ts +++ b/lib/manager/terraform/modules.spec.ts @@ -1,7 +1,7 @@ import { getName } from '../../../test/util'; import { gitTagsRefMatchRegex, githubRefMatchRegex } from './modules'; -describe(getName(__filename), () => { +describe(getName(), () => { describe('githubRefMatchRegex', () => { it('should split project and tag from source', () => { const { project, tag } = githubRefMatchRegex.exec( diff --git a/lib/manager/terraform/util.spec.ts b/lib/manager/terraform/util.spec.ts index ce7f5e7a11b469..678464fc52a1f3 100644 --- a/lib/manager/terraform/util.spec.ts +++ b/lib/manager/terraform/util.spec.ts @@ -1,7 +1,7 @@ import { getName } from '../../../test/util'; import { TerraformDependencyTypes, getTerraformDependencyType } from './util'; -describe(getName(__filename), () => { +describe(getName(), () => { describe('getTerraformDependencyType()', () => { it('returns TerraformDependencyTypes.module', () => { expect(getTerraformDependencyType('module')).toBe( diff --git a/lib/manager/terragrunt-version/extract.spec.ts b/lib/manager/terragrunt-version/extract.spec.ts index d44244501864aa..e5010a2aa9127b 100644 --- a/lib/manager/terragrunt-version/extract.spec.ts +++ b/lib/manager/terragrunt-version/extract.spec.ts @@ -1,7 +1,7 @@ import { getName } from '../../../test/util'; import { extractPackageFile } from './extract'; -describe(getName(__filename), () => { +describe(getName(), () => { describe('extractPackageFile()', () => { it('returns a result', () => { const res = extractPackageFile('12.0.0\n'); diff --git a/lib/manager/terragrunt/extract.spec.ts b/lib/manager/terragrunt/extract.spec.ts index 90626f785bbede..e12406d66f4008 100644 --- a/lib/manager/terragrunt/extract.spec.ts +++ b/lib/manager/terragrunt/extract.spec.ts @@ -1,13 +1,13 @@ import { getName, loadFixture } from '../../../test/util'; import { extractPackageFile } from './extract'; -const tg1 = loadFixture(__filename, '2.hcl'); +const tg1 = loadFixture('2.hcl'); const tg2 = `terragrunt { source = "../../modules/fe" } `; -describe(getName(__filename), () => { +describe(getName(), () => { describe('extractPackageFile()', () => { it('returns null for empty', () => { expect(extractPackageFile('nothing here')).toBeNull(); diff --git a/lib/manager/terragrunt/modules.spec.ts b/lib/manager/terragrunt/modules.spec.ts index 2dcf3a594f8c3c..fe85fdaedda699 100644 --- a/lib/manager/terragrunt/modules.spec.ts +++ b/lib/manager/terragrunt/modules.spec.ts @@ -1,7 +1,7 @@ import { getName } from '../../../test/util'; import { gitTagsRefMatchRegex, githubRefMatchRegex } from './modules'; -describe(getName(__filename), () => { +describe(getName(), () => { describe('githubRefMatchRegex', () => { it('should split project and tag from source', () => { const { project, tag } = githubRefMatchRegex.exec( diff --git a/lib/manager/terragrunt/util.spec.ts b/lib/manager/terragrunt/util.spec.ts index aa6fdecba223d7..cc37ccedaae72d 100644 --- a/lib/manager/terragrunt/util.spec.ts +++ b/lib/manager/terragrunt/util.spec.ts @@ -1,7 +1,7 @@ import { getName } from '../../../test/util'; import { TerragruntDependencyTypes, getTerragruntDependencyType } from './util'; -describe(getName(__filename), () => { +describe(getName(), () => { describe('getTerragruntDependencyType()', () => { it('returns TerragruntDependencyTypes.terragrunt', () => { expect(getTerragruntDependencyType('terraform')).toBe( diff --git a/lib/manager/travis/extract.spec.ts b/lib/manager/travis/extract.spec.ts index 8335256c0c672d..ae579bb36ddd70 100644 --- a/lib/manager/travis/extract.spec.ts +++ b/lib/manager/travis/extract.spec.ts @@ -1,9 +1,9 @@ import { getName, loadFixture } from '../../../test/util'; import { extractPackageFile } from './extract'; -const invalidYAML = loadFixture(__filename, 'invalid.yml'); +const invalidYAML = loadFixture('invalid.yml'); -describe(getName(__filename), () => { +describe(getName(), () => { describe('extractPackageFile()', () => { it('returns empty if fails to parse', () => { const res = extractPackageFile('blahhhhh:foo:@what\n'); diff --git a/lib/manager/travis/package.spec.ts b/lib/manager/travis/package.spec.ts index dc638d12d020c1..862c1c4be036fe 100644 --- a/lib/manager/travis/package.spec.ts +++ b/lib/manager/travis/package.spec.ts @@ -8,7 +8,7 @@ const getPkgReleases: any = _getPkgReleases; jest.mock('../../datasource'); -describe(getName(__filename), () => { +describe(getName(), () => { describe('getPackageUpdates', () => { // TODO: should be `PackageUpdateConfig` let config: any; diff --git a/lib/manager/travis/update.spec.ts b/lib/manager/travis/update.spec.ts index b36897e7f4474b..1ef3529689a3a3 100644 --- a/lib/manager/travis/update.spec.ts +++ b/lib/manager/travis/update.spec.ts @@ -1,9 +1,9 @@ import { getName, loadFixture } from '../../../test/util'; import { updateDependency } from './update'; -const content = loadFixture(__filename, 'travis.yml'); +const content = loadFixture('travis.yml'); -describe(getName(__filename), () => { +describe(getName(), () => { describe('updateDependency', () => { it('updates values', () => { // TODO: should be `Upgrade` diff --git a/lib/platform/azure/azure-got-wrapper.spec.ts b/lib/platform/azure/azure-got-wrapper.spec.ts index e00051becae07e..9cef7080624631 100644 --- a/lib/platform/azure/azure-got-wrapper.spec.ts +++ b/lib/platform/azure/azure-got-wrapper.spec.ts @@ -2,7 +2,7 @@ import { getName } from '../../../test/util'; import { PLATFORM_TYPE_AZURE } from '../../constants/platforms'; import * as _hostRules from '../../util/host-rules'; -describe(getName(__filename), () => { +describe(getName(), () => { let azure: typeof import('./azure-got-wrapper'); let hostRules: typeof _hostRules; beforeEach(() => { diff --git a/lib/platform/azure/azure-helper.spec.ts b/lib/platform/azure/azure-helper.spec.ts index dd6bf34ebd2a6b..3fd0d9ab0c6612 100644 --- a/lib/platform/azure/azure-helper.spec.ts +++ b/lib/platform/azure/azure-helper.spec.ts @@ -2,7 +2,7 @@ import { Readable } from 'stream'; import { GitPullRequestMergeStrategy } from 'azure-devops-node-api/interfaces/GitInterfaces'; import { getName } from '../../../test/util'; -describe(getName(__filename), () => { +describe(getName(), () => { let azureHelper: typeof import('./azure-helper'); let azureApi: jest.Mocked; diff --git a/lib/platform/azure/index.spec.ts b/lib/platform/azure/index.spec.ts index ce063598ae3991..4efe9a59e32ab9 100644 --- a/lib/platform/azure/index.spec.ts +++ b/lib/platform/azure/index.spec.ts @@ -12,7 +12,7 @@ import * as _git from '../../util/git'; import * as _hostRules from '../../util/host-rules'; import type { Platform, RepoParams } from '../types'; -describe(getName(__filename), () => { +describe(getName(), () => { let hostRules: jest.Mocked; let azure: Platform; let azureApi: jest.Mocked; diff --git a/lib/platform/azure/util.spec.ts b/lib/platform/azure/util.spec.ts index 92f1270a1f2772..f6b6edec819736 100644 --- a/lib/platform/azure/util.spec.ts +++ b/lib/platform/azure/util.spec.ts @@ -13,7 +13,7 @@ import { streamToString, } from './util'; -describe(getName(__filename), () => { +describe(getName(), () => { describe('getNewBranchName', () => { it('should add refs/heads', () => { const res = getNewBranchName('testBB'); diff --git a/lib/platform/bitbucket-server/index.spec.ts b/lib/platform/bitbucket-server/index.spec.ts index 6a06f89c81b018..69c3d2a5c4fb46 100644 --- a/lib/platform/bitbucket-server/index.spec.ts +++ b/lib/platform/bitbucket-server/index.spec.ts @@ -169,7 +169,7 @@ const scenarios = { 'endpoint with path': new URL('https://stash.renovatebot.com/vcs'), }; -describe(getName(__filename), () => { +describe(getName(), () => { Object.entries(scenarios).forEach(([scenarioName, url]) => { const urlHost = url.origin; const urlPath = url.pathname === '/' ? '' : url.pathname; diff --git a/lib/platform/bitbucket/comments.spec.ts b/lib/platform/bitbucket/comments.spec.ts index 7cbfb5c34a0b3c..2556bdbd84feb7 100644 --- a/lib/platform/bitbucket/comments.spec.ts +++ b/lib/platform/bitbucket/comments.spec.ts @@ -5,7 +5,7 @@ import * as comments from './comments'; const baseUrl = 'https://api.bitbucket.org'; -describe(getName(__filename), () => { +describe(getName(), () => { const config: comments.CommentsConfig = { repository: 'some/repo' }; beforeEach(() => { diff --git a/lib/platform/bitbucket/index.spec.ts b/lib/platform/bitbucket/index.spec.ts index 068232a2290311..6a0e40e0048bdc 100644 --- a/lib/platform/bitbucket/index.spec.ts +++ b/lib/platform/bitbucket/index.spec.ts @@ -35,7 +35,7 @@ lxml==3.6.0 mccabe==0.6.1 `; -describe(getName(__filename), () => { +describe(getName(), () => { let bitbucket: Platform; let hostRules: jest.Mocked; let git: jest.Mocked; diff --git a/lib/platform/gitea/gitea-helper.spec.ts b/lib/platform/gitea/gitea-helper.spec.ts index fc0fdf292cb2ac..2213effdb80221 100644 --- a/lib/platform/gitea/gitea-helper.spec.ts +++ b/lib/platform/gitea/gitea-helper.spec.ts @@ -4,7 +4,7 @@ import { PrState } from '../../types'; import { setBaseUrl } from '../../util/http/gitea'; import * as ght from './gitea-helper'; -describe(getName(__filename), () => { +describe(getName(), () => { const baseUrl = 'https://gitea.renovatebot.com/api/v1'; const mockCommitHash = '0d9c7726c3d628b7e28af234595cfd20febdbf8e'; diff --git a/lib/platform/gitea/index.spec.ts b/lib/platform/gitea/index.spec.ts index c242124f09ce01..7fca3de799ce9a 100644 --- a/lib/platform/gitea/index.spec.ts +++ b/lib/platform/gitea/index.spec.ts @@ -20,7 +20,7 @@ import * as ght from './gitea-helper'; */ const GITEA_VERSION = '1.14.0+dev-754-g5d2b7ba63'; -describe(getName(__filename), () => { +describe(getName(), () => { let gitea: Platform; let helper: jest.Mocked; let logger: jest.Mocked; diff --git a/lib/platform/github/index.spec.ts b/lib/platform/github/index.spec.ts index f6002def84c42c..aa84436489261e 100644 --- a/lib/platform/github/index.spec.ts +++ b/lib/platform/github/index.spec.ts @@ -11,7 +11,7 @@ import type { Platform } from '../types'; const githubApiHost = 'https://api.github.com'; -describe(getName(__filename), () => { +describe(getName(), () => { let github: Platform; let hostRules: jest.Mocked; let git: jest.Mocked; @@ -41,12 +41,8 @@ describe(getName(__filename), () => { httpMock.reset(); }); - const graphqlOpenPullRequests = loadFixture( - __filename, - 'graphql/pullrequest-1.json' - ); + const graphqlOpenPullRequests = loadFixture('graphql/pullrequest-1.json'); const graphqlClosedPullRequests = loadFixture( - __filename, 'graphql/pullrequests-closed.json' ); diff --git a/lib/platform/gitlab/index.spec.ts b/lib/platform/gitlab/index.spec.ts index 9f31a17ae240cb..713f02c3ef75b4 100644 --- a/lib/platform/gitlab/index.spec.ts +++ b/lib/platform/gitlab/index.spec.ts @@ -17,7 +17,7 @@ import * as _hostRules from '../../util/host-rules'; const gitlabApiHost = 'https://gitlab.com'; -describe(getName(__filename), () => { +describe(getName(), () => { let gitlab: Platform; let hostRules: jest.Mocked; let git: jest.Mocked; diff --git a/lib/platform/index.spec.ts b/lib/platform/index.spec.ts index 7dd014c50be90c..bd9e688af73d5d 100644 --- a/lib/platform/index.spec.ts +++ b/lib/platform/index.spec.ts @@ -7,7 +7,7 @@ import * as platform from '.'; jest.unmock('.'); -describe(getName(__filename), () => { +describe(getName(), () => { beforeEach(() => { jest.resetModules(); }); diff --git a/lib/platform/utils/pr-body.spec.ts b/lib/platform/utils/pr-body.spec.ts index 873b12529919c6..53335f47579fd3 100644 --- a/lib/platform/utils/pr-body.spec.ts +++ b/lib/platform/utils/pr-body.spec.ts @@ -1,9 +1,9 @@ import { getName, loadFixture } from '../../../test/util'; import { smartTruncate } from './pr-body'; -const prBody = loadFixture(__filename, 'pr-body.txt'); +const prBody = loadFixture('pr-body.txt'); -describe(getName(__filename), () => { +describe(getName(), () => { describe('.smartTruncate', () => { it('truncates to 1000', () => { const body = smartTruncate(prBody, 1000); diff --git a/lib/platform/utils/read-only-issue-body.spec.ts b/lib/platform/utils/read-only-issue-body.spec.ts index ef98dedc3d7ef9..48e6b4ac37dc04 100644 --- a/lib/platform/utils/read-only-issue-body.spec.ts +++ b/lib/platform/utils/read-only-issue-body.spec.ts @@ -1,9 +1,9 @@ import { getName, loadFixture } from '../../../test/util'; import { readOnlyIssueBody } from './read-only-issue-body'; -const issueBody = loadFixture(__filename, 'issue-body.txt'); +const issueBody = loadFixture('issue-body.txt'); -describe(getName(__filename), () => { +describe(getName(), () => { describe('.readOnlyIssueBody', () => { it('removes all checkbox formatting', () => { expect(readOnlyIssueBody(issueBody)).toEqual( diff --git a/lib/util/cache/package/file.spec.ts b/lib/util/cache/package/file.spec.ts index 7248343c02bd18..8587885822c506 100644 --- a/lib/util/cache/package/file.spec.ts +++ b/lib/util/cache/package/file.spec.ts @@ -2,7 +2,7 @@ import os from 'os'; import { getName } from '../../../../test/util'; import { get, init, set } from './file'; -describe(getName(__filename), () => { +describe(getName(), () => { it('returns if uninitiated', async () => { await set('test', 'key', 1234); expect(await get('test', 'key')).toBeUndefined(); diff --git a/lib/util/cache/package/index.spec.ts b/lib/util/cache/package/index.spec.ts index c91c9d1abeca27..63f6e32a899730 100644 --- a/lib/util/cache/package/index.spec.ts +++ b/lib/util/cache/package/index.spec.ts @@ -4,7 +4,7 @@ import { cleanup, get, init, set } from '.'; jest.mock('./file'); jest.mock('./redis'); -describe(getName(__filename), () => { +describe(getName(), () => { it('returns undefined if not initialized', async () => { expect(await get('test', 'missing-key')).toBeUndefined(); expect(await set('test', 'some-key', 'some-value', 5)).toBeUndefined(); diff --git a/lib/util/cache/repository/index.spec.ts b/lib/util/cache/repository/index.spec.ts index 9ac8eb0977d879..1095e227df97a6 100644 --- a/lib/util/cache/repository/index.spec.ts +++ b/lib/util/cache/repository/index.spec.ts @@ -6,7 +6,7 @@ jest.mock('fs-extra'); const fs = mocked(_fs); -describe(getName(__filename), () => { +describe(getName(), () => { beforeEach(() => { jest.resetAllMocks(); }); diff --git a/lib/util/emoji.spec.ts b/lib/util/emoji.spec.ts index b07114595662db..b8b15a9660c913 100644 --- a/lib/util/emoji.spec.ts +++ b/lib/util/emoji.spec.ts @@ -1,7 +1,7 @@ import { getName } from '../../test/util'; import { setEmojiConfig, unemojify } from './emoji'; -describe(getName(__filename), () => { +describe(getName(), () => { it('strips emojis when the config has been set accordingly', () => { const emoji = '🚀💎'; const otherText = 'regular text'; diff --git a/lib/util/exec/exec.spec.ts b/lib/util/exec/exec.spec.ts index e5db81a628a4e8..387c15d46c36db 100644 --- a/lib/util/exec/exec.spec.ts +++ b/lib/util/exec/exec.spec.ts @@ -31,7 +31,7 @@ interface TestInput { adminConfig?: RepoAdminConfig; } -describe(getName(__filename), () => { +describe(getName(), () => { let processEnvOrig: NodeJS.ProcessEnv; const cacheDir = '/tmp/renovate/cache/'; diff --git a/lib/util/fs/index.spec.ts b/lib/util/fs/index.spec.ts index 81fe579b984dd3..c79946db3fccf1 100644 --- a/lib/util/fs/index.spec.ts +++ b/lib/util/fs/index.spec.ts @@ -9,7 +9,7 @@ import { writeLocalFile, } from '.'; -describe(getName(__filename), () => { +describe(getName(), () => { describe('readLocalFile', () => { it('reads buffer', async () => { expect(await readLocalFile(__filename)).toBeInstanceOf(Buffer); @@ -25,7 +25,7 @@ describe(getName(__filename), () => { }); }); -describe(getName(__filename), () => { +describe(getName(), () => { describe('localPathExists', () => { it('returns true for file', async () => { expect(await localPathExists(__filename)).toBe(true); @@ -41,7 +41,7 @@ describe(getName(__filename), () => { }); }); -describe(getName(__filename), () => { +describe(getName(), () => { describe('findLocalSiblingOrParent', () => { it('returns path for file', async () => { await withDir( diff --git a/lib/util/fs/proxies.spec.ts b/lib/util/fs/proxies.spec.ts index 4ea97c575553eb..1d04cced94a6d5 100644 --- a/lib/util/fs/proxies.spec.ts +++ b/lib/util/fs/proxies.spec.ts @@ -4,7 +4,7 @@ import { remove } from './proxies'; jest.mock('fs-extra'); -describe(getName(__filename), () => { +describe(getName(), () => { describe('remove', () => { it('should call remove in fs-extra', async () => { (fs.remove as jest.Mock).mockResolvedValue(undefined); diff --git a/lib/util/git/index.spec.ts b/lib/util/git/index.spec.ts index 9e0d33354ec483..b0ae4b96ce60c0 100644 --- a/lib/util/git/index.spec.ts +++ b/lib/util/git/index.spec.ts @@ -4,7 +4,7 @@ import tmp from 'tmp-promise'; import { getName } from '../../../test/util'; import * as git from '.'; -describe(getName(__filename), () => { +describe(getName(), () => { jest.setTimeout(15000); const masterCommitDate = new Date(); diff --git a/lib/util/git/private-key.spec.ts b/lib/util/git/private-key.spec.ts index ca3e61f77fbfcf..964c80271f8f72 100644 --- a/lib/util/git/private-key.spec.ts +++ b/lib/util/git/private-key.spec.ts @@ -11,7 +11,7 @@ jest.mock('../exec'); const exec = mocked(exec_); -describe(getName(__filename), () => { +describe(getName(), () => { describe('writePrivateKey()', () => { it('returns if no private key', async () => { await expect(writePrivateKey()).resolves.not.toThrow(); diff --git a/lib/util/host-rules.spec.ts b/lib/util/host-rules.spec.ts index e8172b4bc43a93..ac6b91c0d9e53b 100644 --- a/lib/util/host-rules.spec.ts +++ b/lib/util/host-rules.spec.ts @@ -3,7 +3,7 @@ import { PLATFORM_TYPE_AZURE } from '../constants/platforms'; import * as datasourceNuget from '../datasource/nuget'; import { add, clear, find, findAll, hosts } from './host-rules'; -describe(getName(__filename), () => { +describe(getName(), () => { beforeEach(() => { clear(); }); diff --git a/lib/util/html.spec.ts b/lib/util/html.spec.ts index 3ca72fd72e4740..7509826c3fec3a 100644 --- a/lib/util/html.spec.ts +++ b/lib/util/html.spec.ts @@ -1,7 +1,7 @@ import { getName } from '../../test/util'; import { HTMLElement, parse } from './html'; -describe(getName(__filename), () => { +describe(getName(), () => { it('parses HTML', () => { const body = parse('
Hello, world!
'); expect(body.childNodes).toHaveLength(1); diff --git a/lib/util/http/auth.spec.ts b/lib/util/http/auth.spec.ts index e612b1958baaee..d053fd3704fb11 100644 --- a/lib/util/http/auth.spec.ts +++ b/lib/util/http/auth.spec.ts @@ -7,7 +7,7 @@ import { import { applyAuthorization, removeAuthorization } from './auth'; import { GotOptions } from './types'; -describe(getName(__filename), () => { +describe(getName(), () => { describe('applyAuthorization', () => { it('does nothing', () => { const opts: GotOptions = { diff --git a/lib/util/http/bitbucket-server.spec.ts b/lib/util/http/bitbucket-server.spec.ts index f4daf43f7fbbe6..efd46a0ac172e3 100644 --- a/lib/util/http/bitbucket-server.spec.ts +++ b/lib/util/http/bitbucket-server.spec.ts @@ -6,7 +6,7 @@ import { BitbucketServerHttp, setBaseUrl } from './bitbucket-server'; const baseUrl = 'https://git.example.com'; -describe(getName(__filename), () => { +describe(getName(), () => { let api: BitbucketServerHttp; beforeEach(() => { api = new BitbucketServerHttp(); diff --git a/lib/util/http/bitbucket.spec.ts b/lib/util/http/bitbucket.spec.ts index 1ef4617c4b236d..2ee810f52b4c6e 100644 --- a/lib/util/http/bitbucket.spec.ts +++ b/lib/util/http/bitbucket.spec.ts @@ -6,7 +6,7 @@ import { BitbucketHttp, setBaseUrl } from './bitbucket'; const baseUrl = 'https://api.bitbucket.org'; -describe(getName(__filename), () => { +describe(getName(), () => { let api: BitbucketHttp; beforeEach(() => { api = new BitbucketHttp(); diff --git a/lib/util/http/gitea.spec.ts b/lib/util/http/gitea.spec.ts index 6af6acf6f01229..6f28781cd9ff0c 100644 --- a/lib/util/http/gitea.spec.ts +++ b/lib/util/http/gitea.spec.ts @@ -2,7 +2,7 @@ import * as httpMock from '../../../test/http-mock'; import { getName } from '../../../test/util'; import { GiteaHttp, setBaseUrl } from './gitea'; -describe(getName(__filename), () => { +describe(getName(), () => { const baseUrl = 'https://gitea.renovatebot.com/api/v1'; let giteaHttp: GiteaHttp; diff --git a/lib/util/http/github.spec.ts b/lib/util/http/github.spec.ts index c7868c8f93a0d0..5e6a9ad57a3b99 100644 --- a/lib/util/http/github.spec.ts +++ b/lib/util/http/github.spec.ts @@ -13,7 +13,7 @@ import { GithubHttp, setBaseUrl } from './github'; const githubApiHost = 'https://api.github.com'; -describe(getName(__filename), () => { +describe(getName(), () => { let githubApi: GithubHttp; beforeEach(() => { githubApi = new GithubHttp(); diff --git a/lib/util/http/gitlab.spec.ts b/lib/util/http/gitlab.spec.ts index 1296a984570c6c..7483bfdba847a9 100644 --- a/lib/util/http/gitlab.spec.ts +++ b/lib/util/http/gitlab.spec.ts @@ -12,7 +12,7 @@ hostRules.add({ const gitlabApiHost = 'https://gitlab.com'; -describe(getName(__filename), () => { +describe(getName(), () => { let gitlabApi: GitlabHttp; beforeEach(() => { diff --git a/lib/util/http/host-rules.spec.ts b/lib/util/http/host-rules.spec.ts index 9810d6febe04c4..f450f61bbae4bf 100644 --- a/lib/util/http/host-rules.spec.ts +++ b/lib/util/http/host-rules.spec.ts @@ -12,7 +12,7 @@ const url = 'https://github.com'; jest.mock('global-agent'); -describe(getName(__filename), () => { +describe(getName(), () => { const options = { hostType: PLATFORM_TYPE_GITHUB, }; diff --git a/lib/util/http/index.spec.ts b/lib/util/http/index.spec.ts index b32a05ee90afda..f4bf4fe2c7fb64 100644 --- a/lib/util/http/index.spec.ts +++ b/lib/util/http/index.spec.ts @@ -10,7 +10,7 @@ import { Http } from '.'; const baseUrl = 'http://renovate.com'; -describe(getName(__filename), () => { +describe(getName(), () => { let http: Http; beforeEach(() => { diff --git a/lib/util/http/queue.spec.ts b/lib/util/http/queue.spec.ts index da6804f9b73fbc..585a7a29db66f7 100644 --- a/lib/util/http/queue.spec.ts +++ b/lib/util/http/queue.spec.ts @@ -1,7 +1,7 @@ import { getName } from '../../../test/util'; import { getQueue } from './queue'; -describe(getName(__filename), () => { +describe(getName(), () => { it('returns null for invalid URL', () => { expect(getQueue(null)).toBeNull(); }); diff --git a/lib/util/index.spec.ts b/lib/util/index.spec.ts index 80cd8e2592edd9..7c4ae4f9ab22f5 100644 --- a/lib/util/index.spec.ts +++ b/lib/util/index.spec.ts @@ -1,7 +1,7 @@ import { getName } from '../../test/util'; import { sampleSize } from '.'; -describe(getName(__filename), () => { +describe(getName(), () => { describe('sampleSize', () => { const array = ['a', 'b', 'c', 'd']; it('returns correct sized array', () => { diff --git a/lib/util/mask.spec.ts b/lib/util/mask.spec.ts index 3e283611d6b1ef..c67ed2818e169e 100644 --- a/lib/util/mask.spec.ts +++ b/lib/util/mask.spec.ts @@ -1,7 +1,7 @@ import { getName } from '../../test/util'; import { maskToken } from './mask'; -describe(getName(__filename), () => { +describe(getName(), () => { describe('.maskToken', () => { it('returns value if passed value is falsy', () => { expect(maskToken('')).toEqual(''); diff --git a/lib/util/object.spec.ts b/lib/util/object.spec.ts index 9056fde1619400..129c2d3bcdd833 100644 --- a/lib/util/object.spec.ts +++ b/lib/util/object.spec.ts @@ -1,7 +1,7 @@ import { getName } from '../../test/util'; import { hasKey } from './object'; -describe(getName(__filename), () => { +describe(getName(), () => { beforeEach(() => { jest.resetModules(); }); diff --git a/lib/util/regex.spec.ts b/lib/util/regex.spec.ts index 09dba7c08311b2..d1f40fac2a9703 100644 --- a/lib/util/regex.spec.ts +++ b/lib/util/regex.spec.ts @@ -4,7 +4,7 @@ import { getName } from '../../test/util'; import { CONFIG_VALIDATION } from '../constants/error-messages'; import { regEx } from './regex'; -describe(getName(__filename), () => { +describe(getName(), () => { beforeEach(() => { jest.resetModules(); }); diff --git a/lib/util/sanitize.spec.ts b/lib/util/sanitize.spec.ts index 1796bce4aa28aa..47a3df11943b94 100644 --- a/lib/util/sanitize.spec.ts +++ b/lib/util/sanitize.spec.ts @@ -1,7 +1,7 @@ import { getName } from '../../test/util'; import { add, clear, sanitize } from './sanitize'; -describe(getName(__filename), () => { +describe(getName(), () => { beforeEach(() => { clear(); }); diff --git a/lib/util/split.spec.ts b/lib/util/split.spec.ts index 7c1a5237444e50..856cff8ad1d3ae 100644 --- a/lib/util/split.spec.ts +++ b/lib/util/split.spec.ts @@ -1,7 +1,7 @@ import { getName } from '../../test/util'; import { addSplit, getSplits, splitInit } from './split'; -describe(getName(__filename), () => { +describe(getName(), () => { it('adds splits and returns results', () => { splitInit(); addSplit('one'); diff --git a/lib/util/template/index.spec.ts b/lib/util/template/index.spec.ts index 2bd2b2101d3018..9d8e3206f4b77c 100644 --- a/lib/util/template/index.spec.ts +++ b/lib/util/template/index.spec.ts @@ -2,7 +2,7 @@ import { getName } from '../../../test/util'; import { getOptions } from '../../config/definitions'; import * as template from '.'; -describe(getName(__filename), () => { +describe(getName(), () => { it('has valid exposed config options', () => { const allOptions = getOptions().map((option) => option.name); const missingOptions = template.exposedConfigOptions.filter( diff --git a/lib/util/url.spec.ts b/lib/util/url.spec.ts index fd4adfc56ff301..e6425b7a84a5eb 100644 --- a/lib/util/url.spec.ts +++ b/lib/util/url.spec.ts @@ -6,7 +6,7 @@ import { validateUrl, } from './url'; -describe(getName(__filename), () => { +describe(getName(), () => { test.each([ ['http://foo.io', '', 'http://foo.io'], ['http://foo.io/', '', 'http://foo.io'], diff --git a/lib/versioning/gradle/index.spec.ts b/lib/versioning/gradle/index.spec.ts index 9a180a63e045d7..7c645edb0978f9 100644 --- a/lib/versioning/gradle/index.spec.ts +++ b/lib/versioning/gradle/index.spec.ts @@ -2,7 +2,7 @@ import { getName } from '../../../test/util'; import { compare, parseMavenBasedRange, parsePrefixRange } from './compare'; import { api } from '.'; -describe(getName(__filename), () => { +describe(getName(), () => { it('returns equality', () => { expect(compare('1', '1')).toEqual(0); expect(compare('a', 'a')).toEqual(0); @@ -113,7 +113,7 @@ describe(getName(__filename), () => { }); }); -describe(getName(__filename), () => { +describe(getName(), () => { it('isValid', () => { expect(api.isValid('1.0.0')).toBe(true); expect(api.isValid('[1.12.6,1.18.6]')).toBe(true); diff --git a/lib/versioning/hex/index.spec.ts b/lib/versioning/hex/index.spec.ts index 2c3b66bfb129e7..a4e219d6e0e125 100644 --- a/lib/versioning/hex/index.spec.ts +++ b/lib/versioning/hex/index.spec.ts @@ -1,7 +1,7 @@ import { getName } from '../../../test/util'; import { api as hexScheme } from '.'; -describe(getName(__filename), () => { +describe(getName(), () => { describe('hexScheme.matches()', () => { it('handles tilde greater than', () => { expect(hexScheme.matches('4.2.0', '~> 4.0')).toBe(true); diff --git a/lib/versioning/ivy/index.spec.ts b/lib/versioning/ivy/index.spec.ts index 28de78297620ec..57bbee555848c7 100644 --- a/lib/versioning/ivy/index.spec.ts +++ b/lib/versioning/ivy/index.spec.ts @@ -9,7 +9,7 @@ import ivy from '.'; const { getNewValue, isValid, isVersion, matches } = ivy; -describe(getName(__filename), () => { +describe(getName(), () => { it('parses dynamic revisions', () => { expect(parseDynamicRevision(null)).toBeNull(); expect(parseDynamicRevision('')).toBeNull(); @@ -61,7 +61,7 @@ describe(getName(__filename), () => { }); }); -describe(getName(__filename), () => { +describe(getName(), () => { it('isValid', () => { expect(isValid('')).toBe(false); expect(isValid('1.0.0')).toBe(true); diff --git a/lib/versioning/loose/utils.spec.ts b/lib/versioning/loose/utils.spec.ts index ef853ab5016a64..94a8e1049e0087 100644 --- a/lib/versioning/loose/utils.spec.ts +++ b/lib/versioning/loose/utils.spec.ts @@ -1,7 +1,7 @@ import { getName } from '../../../test/util'; import { GenericVersion, GenericVersioningApi } from './generic'; -describe(getName(__filename), () => { +describe(getName(), () => { const optionalFunctions = [ 'isLessThanRange', 'valueToVersion', diff --git a/lib/versioning/maven/index.spec.ts b/lib/versioning/maven/index.spec.ts index c17fc53c0e32b1..537d8ba7958aab 100644 --- a/lib/versioning/maven/index.spec.ts +++ b/lib/versioning/maven/index.spec.ts @@ -18,7 +18,7 @@ const { getNewValue, } = maven; -describe(getName(__filename), () => { +describe(getName(), () => { it('returns equality', () => { expect(compare('1.0.0', '1')).toEqual(0); expect(compare('1-a1', '1-alpha-1')).toEqual(0); @@ -286,7 +286,7 @@ describe(getName(__filename), () => { }); }); -describe(getName(__filename), () => { +describe(getName(), () => { it('returns valid', () => { expect(isValid('1.0.0')).toBe(true); expect(isValid('[1.12.6,1.18.6]')).toBe(true); diff --git a/lib/versioning/poetry/index.spec.ts b/lib/versioning/poetry/index.spec.ts index 9df065233a14b9..1838758c1ceafd 100644 --- a/lib/versioning/poetry/index.spec.ts +++ b/lib/versioning/poetry/index.spec.ts @@ -1,7 +1,7 @@ import { getName } from '../../../test/util'; import { api as versionig } from '.'; -describe(getName(__filename), () => { +describe(getName(), () => { describe('equals', () => { it.each([ ['1', '1'], diff --git a/lib/versioning/ubuntu/index.spec.ts b/lib/versioning/ubuntu/index.spec.ts index 3dfcdbe2bc0a36..277859e3d70119 100644 --- a/lib/versioning/ubuntu/index.spec.ts +++ b/lib/versioning/ubuntu/index.spec.ts @@ -1,7 +1,7 @@ import { getName } from '../../../test/util'; import { api as ubuntu } from '.'; -describe(getName(__filename), () => { +describe(getName(), () => { // validation it('isValid', () => { diff --git a/lib/workers/branch/auto-replace.spec.ts b/lib/workers/branch/auto-replace.spec.ts index 125d9237d34620..6b7b62fdb3e4a9 100644 --- a/lib/workers/branch/auto-replace.spec.ts +++ b/lib/workers/branch/auto-replace.spec.ts @@ -4,11 +4,11 @@ import { extractPackageFile } from '../../manager/html'; import type { BranchUpgradeConfig } from '../types'; import { doAutoReplace } from './auto-replace'; -const sampleHtml = loadFixture(__filename, 'sample.html', `../../manager/html`); +const sampleHtml = loadFixture('sample.html', `../../manager/html`); jest.mock('../../util/fs'); -describe(getName(__filename), () => { +describe(getName(), () => { describe('doAutoReplace', () => { let reuseExistingBranch: boolean; let upgrade: BranchUpgradeConfig; diff --git a/lib/workers/branch/automerge.spec.ts b/lib/workers/branch/automerge.spec.ts index d963832fddcf9e..0e6f62784a0c4a 100644 --- a/lib/workers/branch/automerge.spec.ts +++ b/lib/workers/branch/automerge.spec.ts @@ -6,7 +6,7 @@ import { tryBranchAutomerge } from './automerge'; jest.mock('../../util/git'); -describe(getName(__filename), () => { +describe(getName(), () => { describe('tryBranchAutomerge', () => { let config: RenovateConfig; beforeEach(() => { diff --git a/lib/workers/branch/check-existing.spec.ts b/lib/workers/branch/check-existing.spec.ts index e92bcadf84c18d..e20ca7d3369832 100644 --- a/lib/workers/branch/check-existing.spec.ts +++ b/lib/workers/branch/check-existing.spec.ts @@ -3,7 +3,7 @@ import { PrState } from '../../types'; import type { BranchConfig } from '../types'; import { prAlreadyExisted } from './check-existing'; -describe(getName(__filename), () => { +describe(getName(), () => { describe('prAlreadyExisted', () => { let config: BranchConfig; beforeEach(() => { diff --git a/lib/workers/branch/commit.spec.ts b/lib/workers/branch/commit.spec.ts index 50d81df7e20c19..3fd61b5182ced9 100644 --- a/lib/workers/branch/commit.spec.ts +++ b/lib/workers/branch/commit.spec.ts @@ -5,7 +5,7 @@ import { commitFilesToBranch } from './commit'; jest.mock('../../util/git'); -describe(getName(__filename), () => { +describe(getName(), () => { describe('commitFilesToBranch', () => { let config: BranchConfig; beforeEach(() => { diff --git a/lib/workers/branch/get-updated.spec.ts b/lib/workers/branch/get-updated.spec.ts index 5da097965c79d6..132b31bebabe93 100644 --- a/lib/workers/branch/get-updated.spec.ts +++ b/lib/workers/branch/get-updated.spec.ts @@ -21,7 +21,7 @@ jest.mock('../../manager/git-submodules'); jest.mock('../../util/git'); jest.mock('./auto-replace'); -describe(getName(__filename), () => { +describe(getName(), () => { describe('getUpdatedPackageFiles()', () => { let config: BranchConfig; beforeEach(() => { diff --git a/lib/workers/branch/index.spec.ts b/lib/workers/branch/index.spec.ts index fadb85c91c6da2..5d6b829180c09a 100644 --- a/lib/workers/branch/index.spec.ts +++ b/lib/workers/branch/index.spec.ts @@ -62,7 +62,7 @@ const sanitize = mocked(_sanitize); const fs = mocked(_fs); const limits = mocked(_limits); -describe(getName(__filename), () => { +describe(getName(), () => { describe('processBranch', () => { const updatedPackageFiles: PackageFilesResult = { updatedPackageFiles: [], diff --git a/lib/workers/branch/lock-files/index.spec.ts b/lib/workers/branch/lock-files/index.spec.ts index cc4bb406f60be9..dc73ebb3cb843f 100644 --- a/lib/workers/branch/lock-files/index.spec.ts +++ b/lib/workers/branch/lock-files/index.spec.ts @@ -27,7 +27,7 @@ hostRules.find = jest.fn((_) => ({ const { writeUpdatedPackageFiles, getAdditionalFiles } = lockFiles; -describe(getName(__filename), () => { +describe(getName(), () => { describe('writeUpdatedPackageFiles', () => { let config: PostUpdateConfig; beforeEach(() => { diff --git a/lib/workers/branch/reuse.spec.ts b/lib/workers/branch/reuse.spec.ts index 8acbb4e062bd12..1926d260e0f3da 100644 --- a/lib/workers/branch/reuse.spec.ts +++ b/lib/workers/branch/reuse.spec.ts @@ -6,7 +6,7 @@ import { shouldReuseExistingBranch } from './reuse'; jest.mock('../../util/git'); -describe(getName(__filename), () => { +describe(getName(), () => { describe('shouldReuseExistingBranch(config)', () => { const pr: Pr = { sourceBranch: 'master', diff --git a/lib/workers/branch/schedule.spec.ts b/lib/workers/branch/schedule.spec.ts index 4848afff0db2c5..0b0978d9a3dd9a 100644 --- a/lib/workers/branch/schedule.spec.ts +++ b/lib/workers/branch/schedule.spec.ts @@ -3,7 +3,7 @@ import { getName } from '../../../test/util'; import type { RenovateConfig } from '../../config/types'; import * as schedule from './schedule'; -describe(getName(__filename), () => { +describe(getName(), () => { describe('hasValidTimezone(schedule)', () => { it('returns false for invalid timezone', () => { expect(schedule.hasValidTimezone('Asia')[0]).toBe(false); diff --git a/lib/workers/branch/status-checks.spec.ts b/lib/workers/branch/status-checks.spec.ts index 8f1ec712b6ff80..7123d978da6660 100644 --- a/lib/workers/branch/status-checks.spec.ts +++ b/lib/workers/branch/status-checks.spec.ts @@ -2,7 +2,7 @@ import { defaultConfig, getName, platform } from '../../../test/util'; import { BranchStatus } from '../../types'; import { StabilityConfig, setStability } from './status-checks'; -describe(getName(__filename), () => { +describe(getName(), () => { describe('setStability', () => { let config: StabilityConfig; beforeEach(() => { diff --git a/lib/workers/global/autodiscover.spec.ts b/lib/workers/global/autodiscover.spec.ts index cf0da927bc8719..7e5d2f08fa993f 100644 --- a/lib/workers/global/autodiscover.spec.ts +++ b/lib/workers/global/autodiscover.spec.ts @@ -13,7 +13,7 @@ jest.unmock('../../platform'); const hostRules = _hostRules; const ghApi: jest.Mocked = _ghApi as never; -describe(getName(__filename), () => { +describe(getName(), () => { let config: RenovateConfig; beforeEach(async () => { jest.resetAllMocks(); diff --git a/lib/workers/global/index.spec.ts b/lib/workers/global/index.spec.ts index 0ad22392d4bd19..b0478962eee8db 100644 --- a/lib/workers/global/index.spec.ts +++ b/lib/workers/global/index.spec.ts @@ -19,7 +19,7 @@ const configParser: jest.Mocked = _configParser as never; const platform: jest.Mocked = _platform as never; const limits = _limits; -describe(getName(__filename), () => { +describe(getName(), () => { beforeEach(() => { jest.resetAllMocks(); logger.getProblems.mockImplementationOnce(() => []); diff --git a/lib/workers/global/limits.spec.ts b/lib/workers/global/limits.spec.ts index 73a6b401f6575e..1b62c0c7607b97 100644 --- a/lib/workers/global/limits.spec.ts +++ b/lib/workers/global/limits.spec.ts @@ -7,7 +7,7 @@ import { setMaxLimit, } from './limits'; -describe(getName(__filename), () => { +describe(getName(), () => { beforeEach(() => { resetAllLimits(); }); diff --git a/lib/workers/pr/automerge.spec.ts b/lib/workers/pr/automerge.spec.ts index 1343997e39c928..40bfd2433c30c6 100644 --- a/lib/workers/pr/automerge.spec.ts +++ b/lib/workers/pr/automerge.spec.ts @@ -9,7 +9,7 @@ jest.mock('../../util/git'); const platform = mocked(_platform); const defaultConfig = getConfig(); -describe(getName(__filename), () => { +describe(getName(), () => { describe('checkAutoMerge(pr, config)', () => { let config: BranchConfig; let pr: Pr; diff --git a/lib/workers/pr/body/controls.spec.ts b/lib/workers/pr/body/controls.spec.ts index e9efa97beca5f8..8c03c3a5fb9187 100644 --- a/lib/workers/pr/body/controls.spec.ts +++ b/lib/workers/pr/body/controls.spec.ts @@ -5,7 +5,7 @@ import { getControls } from './controls'; jest.mock('../../../util/git'); -describe(getName(__filename), () => { +describe(getName(), () => { describe('getControls', () => { let branchConfig: BranchConfig; beforeEach(() => { diff --git a/lib/workers/pr/changelog/github.spec.ts b/lib/workers/pr/changelog/github.spec.ts index f706f47dc8e053..9a8cf92ec6bd97 100644 --- a/lib/workers/pr/changelog/github.spec.ts +++ b/lib/workers/pr/changelog/github.spec.ts @@ -29,7 +29,7 @@ const upgrade: BranchUpgradeConfig = { ], }; -describe(getName(__filename), () => { +describe(getName(), () => { describe('getChangeLogJSON', () => { beforeEach(() => { hostRules.clear(); diff --git a/lib/workers/pr/changelog/gitlab.spec.ts b/lib/workers/pr/changelog/gitlab.spec.ts index 226371edb65019..2144c81d8871c4 100644 --- a/lib/workers/pr/changelog/gitlab.spec.ts +++ b/lib/workers/pr/changelog/gitlab.spec.ts @@ -31,7 +31,7 @@ const upgrade: BranchUpgradeConfig = { const baseUrl = 'https://gitlab.com/'; -describe(getName(__filename), () => { +describe(getName(), () => { describe('getChangeLogJSON', () => { beforeEach(() => { httpMock.setup(); diff --git a/lib/workers/pr/changelog/index.spec.ts b/lib/workers/pr/changelog/index.spec.ts index 57e0ad20a3e84e..e461f91f2bd253 100644 --- a/lib/workers/pr/changelog/index.spec.ts +++ b/lib/workers/pr/changelog/index.spec.ts @@ -31,7 +31,7 @@ const upgrade: BranchConfig = partial({ ], }); -describe(getName(__filename), () => { +describe(getName(), () => { describe('getChangeLogJSON', () => { beforeEach(() => { httpMock.setup(); diff --git a/lib/workers/pr/changelog/release-notes.spec.ts b/lib/workers/pr/changelog/release-notes.spec.ts index f28f25f667f182..7d8415af16ff61 100644 --- a/lib/workers/pr/changelog/release-notes.spec.ts +++ b/lib/workers/pr/changelog/release-notes.spec.ts @@ -15,20 +15,12 @@ jest.mock('../../../util/host-rules'); const hostRules = mocked(_hostRules); -const angularJsChangelogMd = loadFixture(__filename, 'angular-js.md', '..'); -const jestChangelogMd = loadFixture(__filename, 'jest.md', '..'); -const jsYamlChangelogMd = loadFixture(__filename, 'js-yaml.md', '..'); -const yargsChangelogMd = loadFixture(__filename, 'yargs.md', '..'); -const adapterutilsChangelogMd = loadFixture( - __filename, - 'adapter-utils.md', - '..' -); -const gitterWebappChangelogMd = loadFixture( - __filename, - 'gitter-webapp.md', - '..' -); +const angularJsChangelogMd = loadFixture('angular-js.md', '..'); +const jestChangelogMd = loadFixture('jest.md', '..'); +const jsYamlChangelogMd = loadFixture('js-yaml.md', '..'); +const yargsChangelogMd = loadFixture('yargs.md', '..'); +const adapterutilsChangelogMd = loadFixture('adapter-utils.md', '..'); +const gitterWebappChangelogMd = loadFixture('gitter-webapp.md', '..'); const githubTreeResponse = { tree: [ @@ -44,7 +36,7 @@ const gitlabTreeResponse = [ { path: 'README.md', type: 'blob' }, ]; -describe(getName(__filename), () => { +describe(getName(), () => { beforeEach(() => { httpMock.setup(); hostRules.find.mockReturnValue({}); diff --git a/lib/workers/pr/changelog/releases.spec.ts b/lib/workers/pr/changelog/releases.spec.ts index 9211153b76974a..a0f924c1c6babc 100644 --- a/lib/workers/pr/changelog/releases.spec.ts +++ b/lib/workers/pr/changelog/releases.spec.ts @@ -5,7 +5,7 @@ import * as npmVersioning from '../../../versioning/npm'; import type { BranchUpgradeConfig } from '../../types'; import * as releases from './releases'; -describe(getName(__filename), () => { +describe(getName(), () => { describe('getReleaseNotes()', () => { beforeEach(() => { jest.spyOn(datasource, 'getPkgReleases').mockResolvedValueOnce({ diff --git a/lib/workers/pr/code-owners.spec.ts b/lib/workers/pr/code-owners.spec.ts index b1c7ec28d84b37..9bb83a09ee1911 100644 --- a/lib/workers/pr/code-owners.spec.ts +++ b/lib/workers/pr/code-owners.spec.ts @@ -6,7 +6,7 @@ import { codeOwnersForPr } from './code-owners'; jest.mock('../../util/fs'); jest.mock('../../util/git'); -describe(getName(__filename), () => { +describe(getName(), () => { describe('codeOwnersForPr', () => { let pr: Pr; beforeEach(() => { diff --git a/lib/workers/pr/index.spec.ts b/lib/workers/pr/index.spec.ts index 507d51cda845c7..6eaf4167ac3e85 100644 --- a/lib/workers/pr/index.spec.ts +++ b/lib/workers/pr/index.spec.ts @@ -99,7 +99,7 @@ function setupGitlabChangelogMock() { gitlabChangelogHelper.getChangeLogJSON.mockResolvedValue(resultValue); } -describe(getName(__filename), () => { +describe(getName(), () => { describe('checkAutoMerge(pr, config)', () => { let config: BranchConfig; let pr: Pr; diff --git a/lib/workers/repository/configured.spec.ts b/lib/workers/repository/configured.spec.ts index e65152d94fc2bd..16983952ba6e5b 100644 --- a/lib/workers/repository/configured.spec.ts +++ b/lib/workers/repository/configured.spec.ts @@ -7,7 +7,7 @@ beforeEach(() => { config = getConfig(); }); -describe(getName(__filename), () => { +describe(getName(), () => { describe('checkIfConfigured()', () => { it('returns', () => { expect(() => checkIfConfigured(config)).not.toThrow(); diff --git a/lib/workers/repository/dependency-dashboard.spec.ts b/lib/workers/repository/dependency-dashboard.spec.ts index 35f20a00daf67e..c1c5e974621d66 100644 --- a/lib/workers/repository/dependency-dashboard.spec.ts +++ b/lib/workers/repository/dependency-dashboard.spec.ts @@ -46,7 +46,7 @@ async function dryRun( expect(platform.findPr).toHaveBeenCalledTimes(findPrCalls); } -describe(getName(__filename), () => { +describe(getName(), () => { describe('ensureMasterIssue()', () => { beforeEach(() => { setAdminConfig(); @@ -239,7 +239,7 @@ describe(getName(__filename), () => { config.dependencyDashboardTitle ); expect(platform.ensureIssue.mock.calls[0][0].body).toBe( - loadFixture(__filename, 'master-issue_with_8_PR.txt') + loadFixture('master-issue_with_8_PR.txt') ); expect(platform.getBranchPr).toHaveBeenCalledTimes(0); expect(platform.findPr).toHaveBeenCalledTimes(0); @@ -279,7 +279,7 @@ describe(getName(__filename), () => { config.dependencyDashboardTitle ); expect(platform.ensureIssue.mock.calls[0][0].body).toBe( - loadFixture(__filename, 'master-issue_with_2_PR_edited.txt') + loadFixture('master-issue_with_2_PR_edited.txt') ); expect(platform.getBranchPr).toHaveBeenCalledTimes(2); expect(platform.getBranchPr.mock.calls[0][0]).toBe('branchName1'); @@ -329,7 +329,7 @@ describe(getName(__filename), () => { config.dependencyDashboardTitle ); expect(platform.ensureIssue.mock.calls[0][0].body).toBe( - loadFixture(__filename, 'master-issue_with_3_PR_in_progress.txt') + loadFixture('master-issue_with_3_PR_in_progress.txt') ); expect(platform.getBranchPr).toHaveBeenCalledTimes(3); expect(platform.getBranchPr.mock.calls[0][0]).toBe('branchName1'); @@ -373,7 +373,7 @@ describe(getName(__filename), () => { config.dependencyDashboardTitle ); expect(platform.ensureIssue.mock.calls[0][0].body).toBe( - loadFixture(__filename, 'master-issue_with_2_PR_closed_ignored.txt') + loadFixture('master-issue_with_2_PR_closed_ignored.txt') ); expect(platform.getBranchPr).toHaveBeenCalledTimes(0); expect(platform.findPr).toHaveBeenCalledTimes(2); @@ -431,7 +431,7 @@ describe(getName(__filename), () => { config.dependencyDashboardTitle ); expect(platform.ensureIssue.mock.calls[0][0].body).toBe( - loadFixture(__filename, 'master-issue_with_3_PR_in_approval.txt') + loadFixture('master-issue_with_3_PR_in_approval.txt') ); expect(platform.findPr).toHaveBeenCalledTimes(0); diff --git a/lib/workers/repository/error-config.spec.ts b/lib/workers/repository/error-config.spec.ts index 6c5f39d1a615f2..f0df8e445ad814 100644 --- a/lib/workers/repository/error-config.spec.ts +++ b/lib/workers/repository/error-config.spec.ts @@ -19,7 +19,7 @@ beforeEach(() => { config = getConfig(); }); -describe(getName(__filename), () => { +describe(getName(), () => { describe('raiseConfigWarningIssue()', () => { beforeEach(() => { setAdminConfig(); diff --git a/lib/workers/repository/error.spec.ts b/lib/workers/repository/error.spec.ts index 6d59622d32aed4..f99b290d9694c8 100644 --- a/lib/workers/repository/error.spec.ts +++ b/lib/workers/repository/error.spec.ts @@ -38,7 +38,7 @@ beforeEach(() => { config = getConfig(); }); -describe(getName(__filename), () => { +describe(getName(), () => { describe('handleError()', () => { const errors = [ REPOSITORY_UNINITIATED, diff --git a/lib/workers/repository/extract/file-match.spec.ts b/lib/workers/repository/extract/file-match.spec.ts index 982a9a61b3b239..a87f66406592ed 100644 --- a/lib/workers/repository/extract/file-match.spec.ts +++ b/lib/workers/repository/extract/file-match.spec.ts @@ -3,7 +3,7 @@ import * as fileMatch from './file-match'; jest.mock('../../../util/git'); -describe(getName(__filename), () => { +describe(getName(), () => { const fileList = ['package.json', 'frontend/package.json']; describe('getIncludedFiles()', () => { it('returns fileList if no includePaths', () => { diff --git a/lib/workers/repository/extract/index.spec.ts b/lib/workers/repository/extract/index.spec.ts index 6b05823675fb15..4142dc7094de21 100644 --- a/lib/workers/repository/extract/index.spec.ts +++ b/lib/workers/repository/extract/index.spec.ts @@ -8,7 +8,7 @@ jest.mock('../../../util/git'); const managerFiles = mocked(_managerFiles); -describe(getName(__filename), () => { +describe(getName(), () => { describe('extractAllDependencies()', () => { let config: RenovateConfig; const fileList = ['README', 'package.json', 'tasks/ansible.yaml']; diff --git a/lib/workers/repository/extract/manager-files.spec.ts b/lib/workers/repository/extract/manager-files.spec.ts index cd33536ac3d281..e437014ec40187 100644 --- a/lib/workers/repository/extract/manager-files.spec.ts +++ b/lib/workers/repository/extract/manager-files.spec.ts @@ -11,7 +11,7 @@ jest.mock('../../../util/fs'); const fileMatch = mocked(_fileMatch); const html = mocked(_html); -describe(getName(__filename), () => { +describe(getName(), () => { describe('getManagerPackageFiles()', () => { let config: RenovateConfig; beforeEach(() => { diff --git a/lib/workers/repository/finalise/prune.spec.ts b/lib/workers/repository/finalise/prune.spec.ts index e8cd000e469418..eac6395691f282 100644 --- a/lib/workers/repository/finalise/prune.spec.ts +++ b/lib/workers/repository/finalise/prune.spec.ts @@ -20,7 +20,7 @@ beforeEach(() => { config.warnings = []; }); -describe(getName(__filename), () => { +describe(getName(), () => { describe('pruneStaleBranches()', () => { beforeEach(() => { setAdminConfig(); diff --git a/lib/workers/repository/index.spec.ts b/lib/workers/repository/index.spec.ts index 0d5d50fa13855c..c6c6f5e5c1f922 100644 --- a/lib/workers/repository/index.spec.ts +++ b/lib/workers/repository/index.spec.ts @@ -12,7 +12,7 @@ jest.mock('./process'); jest.mock('./result'); jest.mock('./error'); -describe(getName(__filename), () => { +describe(getName(), () => { describe('renovateRepository()', () => { let config: RenovateConfig; beforeEach(() => { diff --git a/lib/workers/repository/init/apis.spec.ts b/lib/workers/repository/init/apis.spec.ts index 6a24a20e8cd1ad..1a7846d200c298 100644 --- a/lib/workers/repository/init/apis.spec.ts +++ b/lib/workers/repository/init/apis.spec.ts @@ -10,7 +10,7 @@ import { } from '../../../constants/error-messages'; import { initApis } from './apis'; -describe(getName(__filename), () => { +describe(getName(), () => { describe('initApis', () => { let config: RenovateConfig; beforeEach(() => { diff --git a/lib/workers/repository/init/cache.spec.ts b/lib/workers/repository/init/cache.spec.ts index 56fcc98e793d0e..6dbb39a1264897 100644 --- a/lib/workers/repository/init/cache.spec.ts +++ b/lib/workers/repository/init/cache.spec.ts @@ -1,7 +1,7 @@ import { RenovateConfig, getConfig, getName } from '../../../../test/util'; import { initializeCaches } from './cache'; -describe(getName(__filename), () => { +describe(getName(), () => { describe('initializeCaches()', () => { let config: RenovateConfig; beforeEach(() => { diff --git a/lib/workers/repository/init/config.spec.ts b/lib/workers/repository/init/config.spec.ts index aa05fbf28ae731..15084baeb5040f 100644 --- a/lib/workers/repository/init/config.spec.ts +++ b/lib/workers/repository/init/config.spec.ts @@ -31,7 +31,7 @@ beforeEach(() => { jest.mock('../../../config/migration'); jest.mock('../../../config/migrate-validate'); -describe(getName(__filename), () => { +describe(getName(), () => { describe('detectRepoFileConfig()', () => { it('returns config if not found', () => { git.getFileList.mockResolvedValue(['package.json']); diff --git a/lib/workers/repository/init/index.spec.ts b/lib/workers/repository/init/index.spec.ts index 71fcba1b876f99..b5ca2abda7640b 100644 --- a/lib/workers/repository/init/index.spec.ts +++ b/lib/workers/repository/init/index.spec.ts @@ -18,7 +18,7 @@ const config = mocked(_config); const onboarding = mocked(_onboarding); const secrets = mocked(_secrets); -describe(getName(__filename), () => { +describe(getName(), () => { describe('initRepo', () => { it('runs', async () => { apis.initApis.mockResolvedValue({} as never); diff --git a/lib/workers/repository/init/semantic.spec.ts b/lib/workers/repository/init/semantic.spec.ts index ab6def7cd3c849..1ac0f5a3390d79 100644 --- a/lib/workers/repository/init/semantic.spec.ts +++ b/lib/workers/repository/init/semantic.spec.ts @@ -11,7 +11,7 @@ beforeEach(() => { config.warnings = []; }); -describe(getName(__filename), () => { +describe(getName(), () => { describe('detectSemanticCommits()', () => { it('detects false if unknown', async () => { config.semanticCommits = null; diff --git a/lib/workers/repository/init/vulnerability.spec.ts b/lib/workers/repository/init/vulnerability.spec.ts index c3e648704da1c0..55857bc4b63c77 100644 --- a/lib/workers/repository/init/vulnerability.spec.ts +++ b/lib/workers/repository/init/vulnerability.spec.ts @@ -15,7 +15,7 @@ beforeEach(() => { config = JSON.parse(JSON.stringify(defaultConfig)); }); -describe(getName(__filename), () => { +describe(getName(), () => { describe('detectVulnerabilityAlerts()', () => { it('returns if alerts are missing', async () => { delete config.vulnerabilityAlerts; diff --git a/lib/workers/repository/onboarding/branch/config.spec.ts b/lib/workers/repository/onboarding/branch/config.spec.ts index 27551458293679..0ace4010ddfb54 100644 --- a/lib/workers/repository/onboarding/branch/config.spec.ts +++ b/lib/workers/repository/onboarding/branch/config.spec.ts @@ -7,7 +7,7 @@ jest.mock('../../../../config/presets/local'); const mockedPresets = presets as jest.Mocked; -describe(getName(__filename), () => { +describe(getName(), () => { let config: RenovateConfig; let onboardingConfig: string; beforeEach(() => { diff --git a/lib/workers/repository/onboarding/branch/create.spec.ts b/lib/workers/repository/onboarding/branch/create.spec.ts index 3ebd563534ddda..6005cafb01dac0 100644 --- a/lib/workers/repository/onboarding/branch/create.spec.ts +++ b/lib/workers/repository/onboarding/branch/create.spec.ts @@ -25,7 +25,7 @@ const buildExpectedCommitFilesArgument = ( message, }); -describe(getName(__filename), () => { +describe(getName(), () => { let config: RenovateConfig; beforeEach(() => { jest.clearAllMocks(); diff --git a/lib/workers/repository/onboarding/branch/index.spec.ts b/lib/workers/repository/onboarding/branch/index.spec.ts index 52e92a19480934..f2e56792bbcf11 100644 --- a/lib/workers/repository/onboarding/branch/index.spec.ts +++ b/lib/workers/repository/onboarding/branch/index.spec.ts @@ -18,7 +18,7 @@ jest.mock('../../../../workers/repository/onboarding/branch/rebase'); jest.mock('../../../../util/fs'); jest.mock('../../../../util/git'); -describe(getName(__filename), () => { +describe(getName(), () => { describe('checkOnboardingBranch', () => { let config: RenovateConfig; beforeEach(() => { diff --git a/lib/workers/repository/onboarding/branch/rebase.spec.ts b/lib/workers/repository/onboarding/branch/rebase.spec.ts index 90a802a0d2666a..52e12e6f4a738e 100644 --- a/lib/workers/repository/onboarding/branch/rebase.spec.ts +++ b/lib/workers/repository/onboarding/branch/rebase.spec.ts @@ -8,7 +8,7 @@ import { rebaseOnboardingBranch } from './rebase'; jest.mock('../../../../util/git'); -describe(getName(__filename), () => { +describe(getName(), () => { describe('rebaseOnboardingBranch()', () => { let config: RenovateConfig; beforeEach(() => { diff --git a/lib/workers/repository/onboarding/pr/base-branch.spec.ts b/lib/workers/repository/onboarding/pr/base-branch.spec.ts index fae3c6123bd4fb..f15b1554460d5f 100644 --- a/lib/workers/repository/onboarding/pr/base-branch.spec.ts +++ b/lib/workers/repository/onboarding/pr/base-branch.spec.ts @@ -2,7 +2,7 @@ import { RenovateConfig, getConfig, getName } from '../../../../../test/util'; import { getBaseBranchDesc } from './base-branch'; -describe(getName(__filename), () => { +describe(getName(), () => { describe('getBaseBranchDesc()', () => { let config: RenovateConfig; beforeEach(() => { diff --git a/lib/workers/repository/onboarding/pr/config-description.spec.ts b/lib/workers/repository/onboarding/pr/config-description.spec.ts index 583a6de799986a..ee9c10b810ff87 100644 --- a/lib/workers/repository/onboarding/pr/config-description.spec.ts +++ b/lib/workers/repository/onboarding/pr/config-description.spec.ts @@ -2,7 +2,7 @@ import { RenovateConfig, getConfig, getName } from '../../../../../test/util'; import type { PackageFile } from '../../../../manager/types'; import { getConfigDesc } from './config-description'; -describe(getName(__filename), () => { +describe(getName(), () => { describe('getConfigDesc()', () => { let config: RenovateConfig; beforeEach(() => { diff --git a/lib/workers/repository/onboarding/pr/errors-warnings.spec.ts b/lib/workers/repository/onboarding/pr/errors-warnings.spec.ts index b4bf84b3a38453..a34064ea1bd5dd 100644 --- a/lib/workers/repository/onboarding/pr/errors-warnings.spec.ts +++ b/lib/workers/repository/onboarding/pr/errors-warnings.spec.ts @@ -2,7 +2,7 @@ import { RenovateConfig, getConfig, getName } from '../../../../../test/util'; import type { PackageFile } from '../../../../manager/types'; import { getDepWarnings, getErrors, getWarnings } from './errors-warnings'; -describe(getName(__filename), () => { +describe(getName(), () => { describe('getWarnings()', () => { let config: RenovateConfig; beforeEach(() => { diff --git a/lib/workers/repository/onboarding/pr/index.spec.ts b/lib/workers/repository/onboarding/pr/index.spec.ts index 516e86f852bf5b..52060ab572ba46 100644 --- a/lib/workers/repository/onboarding/pr/index.spec.ts +++ b/lib/workers/repository/onboarding/pr/index.spec.ts @@ -15,7 +15,7 @@ import { ensureOnboardingPr } from '.'; jest.mock('../../../../util/git'); -describe(getName(__filename), () => { +describe(getName(), () => { describe('ensureOnboardingPr()', () => { let config: RenovateConfig; let packageFiles: Record; diff --git a/lib/workers/repository/onboarding/pr/pr-list.spec.ts b/lib/workers/repository/onboarding/pr/pr-list.spec.ts index 742419fbce1976..66ec9acf9ae1d5 100644 --- a/lib/workers/repository/onboarding/pr/pr-list.spec.ts +++ b/lib/workers/repository/onboarding/pr/pr-list.spec.ts @@ -2,7 +2,7 @@ import { RenovateConfig, getConfig, getName } from '../../../../../test/util'; import type { BranchConfig } from '../../../types'; import { getPrList } from './pr-list'; -describe(getName(__filename), () => { +describe(getName(), () => { describe('getPrList()', () => { let config: RenovateConfig; beforeEach(() => { diff --git a/lib/workers/repository/process/deprecated.spec.ts b/lib/workers/repository/process/deprecated.spec.ts index d5bc7dd78b047c..bc11689699b3c6 100644 --- a/lib/workers/repository/process/deprecated.spec.ts +++ b/lib/workers/repository/process/deprecated.spec.ts @@ -1,7 +1,7 @@ import { RenovateConfig, getName, platform } from '../../../../test/util'; import { raiseDeprecationWarnings } from './deprecated'; -describe(getName(__filename), () => { +describe(getName(), () => { describe('raiseDeprecationWarnings()', () => { it('returns if onboarding', async () => { const config = {}; diff --git a/lib/workers/repository/process/extract-update.spec.ts b/lib/workers/repository/process/extract-update.spec.ts index bf0b61b4f4cddf..7c63cf3c939f8c 100644 --- a/lib/workers/repository/process/extract-update.spec.ts +++ b/lib/workers/repository/process/extract-update.spec.ts @@ -21,7 +21,7 @@ branchify.branchifyUpgrades.mockResolvedValueOnce({ branchList: ['branchName'], }); -describe(getName(__filename), () => { +describe(getName(), () => { describe('extract()', () => { it('runs with no baseBranches', async () => { const config = { diff --git a/lib/workers/repository/process/fetch.spec.ts b/lib/workers/repository/process/fetch.spec.ts index d87cb4c3c12f25..7830d71694ad8b 100644 --- a/lib/workers/repository/process/fetch.spec.ts +++ b/lib/workers/repository/process/fetch.spec.ts @@ -16,7 +16,7 @@ const lookupUpdates = mocked(lookup).lookupUpdates; jest.mock('./lookup'); -describe(getName(__filename), () => { +describe(getName(), () => { describe('fetchUpdates()', () => { let config: RenovateConfig; beforeEach(() => { diff --git a/lib/workers/repository/process/index.spec.ts b/lib/workers/repository/process/index.spec.ts index e4fc2f7db3c7ff..1f37b330ca1b61 100644 --- a/lib/workers/repository/process/index.spec.ts +++ b/lib/workers/repository/process/index.spec.ts @@ -19,7 +19,7 @@ beforeEach(() => { config = getConfig(); }); -describe(getName(__filename), () => { +describe(getName(), () => { describe('processRepo()', () => { it('processes single branches', async () => { const res = await extractDependencies(config); diff --git a/lib/workers/repository/process/limits.spec.ts b/lib/workers/repository/process/limits.spec.ts index 0d9b3ecc3cec85..01f49ce673f9be 100644 --- a/lib/workers/repository/process/limits.spec.ts +++ b/lib/workers/repository/process/limits.spec.ts @@ -18,7 +18,7 @@ beforeEach(() => { config = getConfig(); }); -describe(getName(__filename), () => { +describe(getName(), () => { describe('getPrHourlyRemaining()', () => { it('calculates hourly limit remaining', async () => { const time = DateTime.local(); diff --git a/lib/workers/repository/process/lookup/index.spec.ts b/lib/workers/repository/process/lookup/index.spec.ts index d457c3a565ee53..4dbcba81da6f0f 100644 --- a/lib/workers/repository/process/lookup/index.spec.ts +++ b/lib/workers/repository/process/lookup/index.spec.ts @@ -30,23 +30,15 @@ jest.mock('../../../../datasource/github-releases'); const fixtureRoot = '../../../../config/npm'; const qJson = { - ...loadJsonFixture(__filename, '01.json', fixtureRoot), + ...loadJsonFixture('01.json', fixtureRoot), latestVersion: '1.4.1', }; -const helmetJson = loadJsonFixture(__filename, '02.json', fixtureRoot); -const coffeelintJson = loadJsonFixture( - __filename, - 'coffeelint.json', - fixtureRoot -); -const nextJson = loadJsonFixture(__filename, 'next.json', fixtureRoot); -const typescriptJson = loadJsonFixture( - __filename, - 'typescript.json', - fixtureRoot -); -const vueJson = loadJsonFixture(__filename, 'vue.json', fixtureRoot); -const webpackJson = loadJsonFixture(__filename, 'webpack.json', fixtureRoot); +const helmetJson = loadJsonFixture('02.json', fixtureRoot); +const coffeelintJson = loadJsonFixture('coffeelint.json', fixtureRoot); +const nextJson = loadJsonFixture('next.json', fixtureRoot); +const typescriptJson = loadJsonFixture('typescript.json', fixtureRoot); +const vueJson = loadJsonFixture('vue.json', fixtureRoot); +const webpackJson = loadJsonFixture('webpack.json', fixtureRoot); const docker = mocked(datasourceDocker) as any; docker.defaultRegistryUrls = ['https://index.docker.io']; @@ -57,7 +49,7 @@ Object.assign(githubReleases, { defaultRegistryUrls: ['https://github.com'] }); let config: LookupUpdateConfig; -describe(getName(__filename), () => { +describe(getName(), () => { beforeEach(() => { // TODO: fix types config = partial(getConfig()); diff --git a/lib/workers/repository/process/sort.spec.ts b/lib/workers/repository/process/sort.spec.ts index 9f2fd3c306ad8d..cbb0b5dd7eb694 100644 --- a/lib/workers/repository/process/sort.spec.ts +++ b/lib/workers/repository/process/sort.spec.ts @@ -2,7 +2,7 @@ import { getName } from '../../../../test/util'; import type { UpdateType } from '../../../config/types'; import { sortBranches } from './sort'; -describe(getName(__filename), () => { +describe(getName(), () => { describe('sortBranches()', () => { it('sorts based on updateType and prTitle', () => { const branches = [ diff --git a/lib/workers/repository/process/write.spec.ts b/lib/workers/repository/process/write.spec.ts index a8c5fcd96df7a3..a0f3f064162bf6 100644 --- a/lib/workers/repository/process/write.spec.ts +++ b/lib/workers/repository/process/write.spec.ts @@ -27,7 +27,7 @@ beforeEach(() => { config = getConfig(); }); -describe(getName(__filename), () => { +describe(getName(), () => { describe('writeUpdates()', () => { it('stops after automerge', async () => { const branches: BranchConfig[] = [ diff --git a/lib/workers/repository/result.spec.ts b/lib/workers/repository/result.spec.ts index e005284bad7152..781bcc717ffaf3 100644 --- a/lib/workers/repository/result.spec.ts +++ b/lib/workers/repository/result.spec.ts @@ -7,7 +7,7 @@ beforeEach(() => { config = getConfig(); }); -describe(getName(__filename), () => { +describe(getName(), () => { describe('processResult()', () => { it('runs', () => { const result = processResult(config, 'done'); diff --git a/lib/workers/repository/stats.spec.ts b/lib/workers/repository/stats.spec.ts index d4afe0aed98b1d..4408d53dae0e42 100644 --- a/lib/workers/repository/stats.spec.ts +++ b/lib/workers/repository/stats.spec.ts @@ -6,7 +6,7 @@ jest.mock('../../util/cache/memory'); const memCache: any = memCache_ as any; -describe(getName(__filename), () => { +describe(getName(), () => { describe('printRequestStats()', () => { it('runs', () => { memCache.get = jest.fn(() => [ diff --git a/lib/workers/repository/updates/branch-name.spec.ts b/lib/workers/repository/updates/branch-name.spec.ts index 4a495f747bfb5f..4b97be036b5b19 100644 --- a/lib/workers/repository/updates/branch-name.spec.ts +++ b/lib/workers/repository/updates/branch-name.spec.ts @@ -2,7 +2,7 @@ import { getName } from '../../../../test/util'; import type { RenovateConfig } from '../../../config/types'; import { generateBranchName } from './branch-name'; -describe(getName(__filename), () => { +describe(getName(), () => { describe('getBranchName()', () => { it('uses groupName if no slug defined', () => { const upgrade: RenovateConfig = { diff --git a/lib/workers/repository/updates/branchify.spec.ts b/lib/workers/repository/updates/branchify.spec.ts index d549938a9cbe2d..8a5fd948866f90 100644 --- a/lib/workers/repository/updates/branchify.spec.ts +++ b/lib/workers/repository/updates/branchify.spec.ts @@ -18,7 +18,7 @@ beforeEach(() => { config.warnings = []; }); -describe(getName(__filename), () => { +describe(getName(), () => { describe('branchifyUpgrades()', () => { it('returns empty', async () => { flattenUpdates.mockResolvedValueOnce([]); diff --git a/lib/workers/repository/updates/flatten.spec.ts b/lib/workers/repository/updates/flatten.spec.ts index 4fb7190b04d926..27ec2dbdd9863b 100644 --- a/lib/workers/repository/updates/flatten.spec.ts +++ b/lib/workers/repository/updates/flatten.spec.ts @@ -11,7 +11,7 @@ beforeEach(() => { config.warnings = []; }); -describe(getName(__filename), () => { +describe(getName(), () => { describe('flattenUpdates()', () => { it('flattens', async () => { config.lockFileMaintenance.enabled = true; diff --git a/lib/workers/repository/updates/generate.spec.ts b/lib/workers/repository/updates/generate.spec.ts index 01aa40b2ef5103..50c947bd37d91d 100644 --- a/lib/workers/repository/updates/generate.spec.ts +++ b/lib/workers/repository/updates/generate.spec.ts @@ -8,7 +8,7 @@ beforeEach(() => { jest.resetAllMocks(); }); -describe(getName(__filename), () => { +describe(getName(), () => { describe('generateBranchConfig()', () => { it('does not group single upgrade', () => { const branch = [ diff --git a/lib/workers/repository/util/commit-message.spec.ts b/lib/workers/repository/util/commit-message.spec.ts index 5219209c13424d..6a263b014bb07f 100644 --- a/lib/workers/repository/util/commit-message.spec.ts +++ b/lib/workers/repository/util/commit-message.spec.ts @@ -4,7 +4,7 @@ import { formatCommitMessagePrefix, } from './commit-message'; -describe(getName(__filename), () => { +describe(getName(), () => { describe('COMMIT_MESSAGE_PREFIX_END_CHARACTER', () => { it('is a colon character', () => { expect(COMMIT_MESSAGE_PREFIX_SEPARATOR).toBe(':'); diff --git a/test/util.ts b/test/util.ts index e45057b9d29099..50119e4e66cff9 100644 --- a/test/util.ts +++ b/test/util.ts @@ -41,17 +41,48 @@ export const defaultConfig = getConfig(); export { getConfig }; -export function getName(file: string): string { +function getCallerFileName(): string | null { + let result = null; + + const prepareStackTrace = Error.prepareStackTrace; + const stackTraceLimit = Error.stackTraceLimit; + + Error.prepareStackTrace = (_err, stack) => stack; + Error.stackTraceLimit = 5; // max calls inside this file + 1 + + try { + const err = new Error(); + + const stack = (err.stack as unknown) as NodeJS.CallSite[]; + + let currentFile = null; + for (const frame of stack) { + const fileName = frame.getFileName(); + if (!currentFile) { + currentFile = fileName; + } else if (currentFile !== fileName) { + result = fileName; + break; + } + } + } catch (e) { + // no-op + } + + Error.prepareStackTrace = prepareStackTrace; + Error.stackTraceLimit = stackTraceLimit; + + return result; +} + +export function getName(): string { + const file = getCallerFileName(); const [, name] = /lib\/(.*?)\.spec\.ts$/.exec(file.replace(/\\/g, '/')); return name; } -export function loadFixture( - currentFile: string, - fixtureFile: string, - fixtureRoot = '.' -): string { - const callerDir = upath.dirname(currentFile); +export function loadFixture(fixtureFile: string, fixtureRoot = '.'): string { + const callerDir = upath.dirname(getCallerFileName()); const fixtureAbsFile = upath.join( callerDir, fixtureRoot, @@ -62,11 +93,10 @@ export function loadFixture( } export function loadJsonFixture( - currentFile: string, fixtureFile: string, fixtureRoot = '.' ): T { - const rawFixture = loadFixture(currentFile, fixtureFile, fixtureRoot); + const rawFixture = loadFixture(fixtureFile, fixtureRoot); return JSON.parse(rawFixture) as T; }