From 72d97ec2f44e183318e804f71fb90bc729cfa33e Mon Sep 17 00:00:00 2001 From: Sergei Zharinov <zharinov@users.noreply.github.com> Date: Tue, 13 Apr 2021 14:25:51 +0400 Subject: [PATCH] refactor(workers): Enforce getName usage (#9525) --- lib/config/cli.spec.ts | 3 +- lib/config/decrypt.spec.ts | 3 +- lib/config/env.spec.ts | 3 +- lib/config/file.spec.ts | 3 +- lib/config/index.spec.ts | 3 +- lib/config/massage.spec.ts | 3 +- lib/config/migrate-validate.spec.ts | 4 +- lib/config/migration.spec.ts | 3 +- .../presets/__snapshots__/index.spec.ts.snap | 150 ++++++------ lib/config/presets/index.spec.ts | 4 +- lib/config/presets/internal/index.spec.ts | 4 +- .../npm/__snapshots__/index.spec.ts.snap | 2 +- lib/config/presets/npm/index.spec.ts | 3 +- lib/config/validation.spec.ts | 3 +- lib/logger/config-serializer.spec.ts | 3 +- lib/logger/err-serializer.spec.ts | 4 +- lib/logger/pretty-stdout.spec.ts | 3 +- .../__snapshots__/azure-helper.spec.ts.snap | 12 +- .../azure/__snapshots__/index.spec.ts.snap | 58 ++--- .../azure/__snapshots__/util.spec.ts.snap | 20 +- lib/platform/azure/azure-got-wrapper.spec.ts | 3 +- lib/platform/azure/azure-helper.spec.ts | 3 +- lib/platform/azure/index.spec.ts | 3 +- lib/platform/azure/util.spec.ts | 3 +- .../__snapshots__/index.spec.ts.snap | 106 ++++---- lib/platform/bitbucket/index.spec.ts | 3 +- .../github/__snapshots__/index.spec.ts.snap | 230 +++++++++--------- lib/platform/github/index.spec.ts | 4 +- .../gitlab/__snapshots__/index.spec.ts.snap | 186 +++++++------- lib/platform/gitlab/index.spec.ts | 3 +- lib/platform/utils/pr-body.spec.ts | 3 +- .../utils/read-only-issue-body.spec.ts | 3 +- lib/util/cache/package/file.spec.ts | 3 +- lib/util/cache/repository/index.spec.ts | 4 +- lib/util/fs/proxies.spec.ts | 3 +- lib/util/git/__snapshots__/index.spec.ts.snap | 12 +- lib/util/git/index.spec.ts | 3 +- lib/util/host-rules.spec.ts | 3 +- lib/util/mask.spec.ts | 3 +- lib/util/object.spec.ts | 3 +- lib/util/regex.spec.ts | 3 +- lib/util/sanitize.spec.ts | 3 +- lib/util/split.spec.ts | 3 +- .../template/__snapshots__/index.spec.ts.snap | 2 +- lib/util/template/index.spec.ts | 3 +- lib/util/url.spec.ts | 3 +- .../branch/__snapshots__/commit.spec.ts.snap | 2 +- lib/workers/branch/auto-replace.spec.ts | 4 +- lib/workers/branch/automerge.spec.ts | 4 +- lib/workers/branch/check-existing.spec.ts | 4 +- lib/workers/branch/commit.spec.ts | 4 +- lib/workers/branch/get-updated.spec.ts | 4 +- lib/workers/branch/index.spec.ts | 10 +- .../__snapshots__/index.spec.ts.snap | 4 +- lib/workers/branch/lock-files/index.spec.ts | 4 +- lib/workers/branch/schedule.spec.ts | 3 +- lib/workers/branch/status-checks.spec.ts | 4 +- lib/workers/global/autodiscover.spec.ts | 3 +- lib/workers/global/index.spec.ts | 4 +- lib/workers/global/limits.spec.ts | 3 +- .../pr/__snapshots__/index.spec.ts.snap | 30 +-- lib/workers/pr/body/controls.spec.ts | 4 +- lib/workers/pr/code-owners.spec.ts | 4 +- lib/workers/pr/index.spec.ts | 4 +- .../dependency-dashboard.spec.ts.snap | 6 +- .../__snapshots__/index.spec.ts.snap | 2 +- lib/workers/repository/configured.spec.ts | 4 +- .../repository/dependency-dashboard.spec.ts | 3 +- lib/workers/repository/error-config.spec.ts | 9 +- lib/workers/repository/error.spec.ts | 4 +- .../repository/extract/file-match.spec.ts | 4 +- lib/workers/repository/extract/index.spec.ts | 4 +- .../repository/extract/manager-files.spec.ts | 4 +- lib/workers/repository/finalise/prune.spec.ts | 3 +- lib/workers/repository/index.spec.ts | 4 +- .../init/__snapshots__/index.spec.ts.snap | 2 +- lib/workers/repository/init/apis.spec.ts | 9 +- lib/workers/repository/init/cache.spec.ts | 4 +- lib/workers/repository/init/config.spec.ts | 3 +- lib/workers/repository/init/index.spec.ts | 4 +- lib/workers/repository/init/semantic.spec.ts | 4 +- .../repository/init/vulnerability.spec.ts | 3 +- .../branch/__snapshots__/index.spec.ts.snap | 2 +- .../onboarding/branch/config.spec.ts | 4 +- .../onboarding/branch/create.spec.ts | 4 +- .../onboarding/branch/index.spec.ts | 3 +- .../onboarding/branch/rebase.spec.ts | 9 +- .../onboarding/pr/base-branch.spec.ts | 4 +- .../onboarding/pr/config-description.spec.ts | 4 +- .../onboarding/pr/errors-warnings.spec.ts | 4 +- .../repository/onboarding/pr/index.spec.ts | 3 +- .../repository/onboarding/pr/pr-list.spec.ts | 4 +- .../repository/process/deprecated.spec.ts | 4 +- .../repository/process/extract-update.spec.ts | 4 +- lib/workers/repository/process/fetch.spec.ts | 9 +- lib/workers/repository/process/index.spec.ts | 10 +- lib/workers/repository/process/limits.spec.ts | 3 +- .../lookup/__snapshots__/index.spec.ts.snap | 184 +++++++------- .../repository/process/lookup/index.spec.ts | 4 +- lib/workers/repository/process/sort.spec.ts | 3 +- lib/workers/repository/process/write.spec.ts | 10 +- lib/workers/repository/result.spec.ts | 4 +- lib/workers/repository/stats.spec.ts | 3 +- .../repository/updates/branch-name.spec.ts | 3 +- .../repository/updates/branchify.spec.ts | 4 +- .../repository/updates/flatten.spec.ts | 4 +- .../repository/updates/generate.spec.ts | 4 +- .../repository/util/commit-message.spec.ts | 3 +- 108 files changed, 723 insertions(+), 641 deletions(-) diff --git a/lib/config/cli.spec.ts b/lib/config/cli.spec.ts index 9ad91f8e76..bf95f618d9 100644 --- a/lib/config/cli.spec.ts +++ b/lib/config/cli.spec.ts @@ -1,9 +1,10 @@ +import { getName } from '../../test/util'; import * as datasourceDocker from '../datasource/docker'; import * as cli from './cli'; import getArgv from './config/__fixtures__/argv'; import type { RenovateOptions } from './types'; -describe('config/cli', () => { +describe(getName(__filename), () => { let argv: string[]; beforeEach(() => { argv = getArgv(); diff --git a/lib/config/decrypt.spec.ts b/lib/config/decrypt.spec.ts index 3910758dac..5bf81c44af 100644 --- a/lib/config/decrypt.spec.ts +++ b/lib/config/decrypt.spec.ts @@ -1,11 +1,12 @@ import fs from 'fs'; +import { getName } from '../../test/util'; import { setAdminConfig } from './admin'; import { decryptConfig } from './decrypt'; import { RenovateConfig } from '.'; const privateKey = fs.readFileSync('lib/config/keys/__fixtures__/private.pem'); -describe('config/decrypt', () => { +describe(getName(__filename), () => { describe('decryptConfig()', () => { let config: RenovateConfig; beforeEach(() => { diff --git a/lib/config/env.spec.ts b/lib/config/env.spec.ts index 13d2311362..58a08bbfd4 100644 --- a/lib/config/env.spec.ts +++ b/lib/config/env.spec.ts @@ -1,3 +1,4 @@ +import { getName } from '../../test/util'; import { PLATFORM_TYPE_BITBUCKET, PLATFORM_TYPE_GITLAB, @@ -5,7 +6,7 @@ import { import * as env from './env'; import type { RenovateOptions } from './types'; -describe('config/env', () => { +describe(getName(__filename), () => { 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 1383858da9..a75f18e7e5 100644 --- a/lib/config/file.spec.ts +++ b/lib/config/file.spec.ts @@ -1,10 +1,11 @@ import fs from 'fs'; import { DirectoryResult, dir } from 'tmp-promise'; import upath from 'upath'; +import { getName } from '../../test/util'; import customConfig from './config/__fixtures__/file'; import * as file from './file'; -describe('config/file', () => { +describe(getName(__filename), () => { let tmp: DirectoryResult; beforeAll(async () => { diff --git a/lib/config/index.spec.ts b/lib/config/index.spec.ts index 79a2fc0d0d..08dd9dd7f1 100644 --- a/lib/config/index.spec.ts +++ b/lib/config/index.spec.ts @@ -1,4 +1,5 @@ import upath from 'upath'; +import { getName } from '../../test/util'; import { readFile } from '../util/fs'; import getArgv from './config/__fixtures__/argv'; import { getConfig } from './defaults'; @@ -12,7 +13,7 @@ try { const defaultConfig = getConfig(); -describe('config/index', () => { +describe(getName(__filename), () => { 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 04b6eb6c46..54ee01afca 100644 --- a/lib/config/massage.spec.ts +++ b/lib/config/massage.spec.ts @@ -1,7 +1,8 @@ +import { getName } from '../../test/util'; import * as massage from './massage'; import { RenovateConfig } from '.'; -describe('config/massage', () => { +describe(getName(__filename), () => { 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 81057deaac..bd1de334b8 100644 --- a/lib/config/migrate-validate.spec.ts +++ b/lib/config/migrate-validate.spec.ts @@ -1,4 +1,4 @@ -import { RenovateConfig, getConfig } from '../../test/util'; +import { RenovateConfig, getConfig, getName } from '../../test/util'; import { migrateAndValidate } from './migrate-validate'; let config: RenovateConfig; @@ -7,7 +7,7 @@ beforeEach(() => { config = getConfig(); }); -describe('config/migrate-validate', () => { +describe(getName(__filename), () => { 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 ba28db45b9..3b2bdb7bc7 100644 --- a/lib/config/migration.spec.ts +++ b/lib/config/migration.spec.ts @@ -1,3 +1,4 @@ +import { getName } from '../../test/util'; import { PLATFORM_TYPE_GITHUB } from '../constants/platforms'; import { getConfig } from './defaults'; import * as configMigration from './migration'; @@ -10,7 +11,7 @@ interface RenovateConfig extends _RenovateConfig { node?: RenovateSharedConfig & { supportPolicy?: unknown }; } -describe('config/migration', () => { +describe(getName(__filename), () => { describe('migrateConfig(config, parentConfig)', () => { it('migrates config', () => { const config: RenovateConfig = { diff --git a/lib/config/presets/__snapshots__/index.spec.ts.snap b/lib/config/presets/__snapshots__/index.spec.ts.snap index 1b661e5c00..0137555929 100644 --- a/lib/config/presets/__snapshots__/index.spec.ts.snap +++ b/lib/config/presets/__snapshots__/index.spec.ts.snap @@ -1,6 +1,6 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP -exports[`config/presets getPreset gets linters 1`] = ` +exports[`config/presets/index getPreset gets linters 1`] = ` Object { "description": Array [ "All lint-related packages", @@ -17,7 +17,7 @@ Object { } `; -exports[`config/presets getPreset gets parameterised configs 1`] = ` +exports[`config/presets/index getPreset gets parameterised configs 1`] = ` Object { "description": Array [ "Group eslint packages into same branch/PR", @@ -33,13 +33,13 @@ Object { } `; -exports[`config/presets getPreset handles 404 packages 1`] = `undefined`; +exports[`config/presets/index getPreset handles 404 packages 1`] = `undefined`; -exports[`config/presets getPreset handles 404 packages 2`] = `undefined`; +exports[`config/presets/index getPreset handles 404 packages 2`] = `undefined`; -exports[`config/presets getPreset handles 404 packages 3`] = `undefined`; +exports[`config/presets/index getPreset handles 404 packages 3`] = `undefined`; -exports[`config/presets getPreset handles missing params 1`] = ` +exports[`config/presets/index getPreset handles missing params 1`] = ` Object { "description": Array [ "Group {{arg1}} packages into same branch/PR", @@ -55,25 +55,25 @@ Object { } `; -exports[`config/presets getPreset handles no config 1`] = `undefined`; +exports[`config/presets/index getPreset handles no config 1`] = `undefined`; -exports[`config/presets getPreset handles no config 2`] = `undefined`; +exports[`config/presets/index getPreset handles no config 2`] = `undefined`; -exports[`config/presets getPreset handles no config 3`] = `undefined`; +exports[`config/presets/index getPreset handles no config 3`] = `undefined`; -exports[`config/presets getPreset handles preset not found 1`] = `undefined`; +exports[`config/presets/index getPreset handles preset not found 1`] = `undefined`; -exports[`config/presets getPreset handles preset not found 2`] = `undefined`; +exports[`config/presets/index getPreset handles preset not found 2`] = `undefined`; -exports[`config/presets getPreset handles preset not found 3`] = `undefined`; +exports[`config/presets/index getPreset handles preset not found 3`] = `undefined`; -exports[`config/presets getPreset handles throw errors 1`] = `undefined`; +exports[`config/presets/index getPreset handles throw errors 1`] = `undefined`; -exports[`config/presets getPreset handles throw errors 2`] = `undefined`; +exports[`config/presets/index getPreset handles throw errors 2`] = `undefined`; -exports[`config/presets getPreset handles throw errors 3`] = `undefined`; +exports[`config/presets/index getPreset handles throw errors 3`] = `undefined`; -exports[`config/presets getPreset ignores irrelevant params 1`] = ` +exports[`config/presets/index getPreset ignores irrelevant params 1`] = ` Object { "description": Array [ "Use version pinning (maintain a single version only and not semver ranges)", @@ -82,7 +82,7 @@ Object { } `; -exports[`config/presets parsePreset parses gitea 1`] = ` +exports[`config/presets/index parsePreset parses gitea 1`] = ` Object { "packageName": "some/repo", "params": undefined, @@ -92,7 +92,7 @@ Object { } `; -exports[`config/presets parsePreset parses github 1`] = ` +exports[`config/presets/index parsePreset parses github 1`] = ` Object { "packageName": "some/repo", "params": undefined, @@ -102,7 +102,7 @@ Object { } `; -exports[`config/presets parsePreset parses github subdirectories 1`] = ` +exports[`config/presets/index parsePreset parses github subdirectories 1`] = ` Object { "packageName": "some/repo", "params": undefined, @@ -112,7 +112,7 @@ Object { } `; -exports[`config/presets parsePreset parses github subfiles 1`] = ` +exports[`config/presets/index parsePreset parses github subfiles 1`] = ` Object { "packageName": "some/repo", "params": undefined, @@ -122,7 +122,7 @@ Object { } `; -exports[`config/presets parsePreset parses github subfiles with preset and sub-preset name 1`] = ` +exports[`config/presets/index parsePreset parses github subfiles with preset and sub-preset name 1`] = ` Object { "packageName": "some/repo", "params": undefined, @@ -132,7 +132,7 @@ Object { } `; -exports[`config/presets parsePreset parses github subfiles with preset name 1`] = ` +exports[`config/presets/index parsePreset parses github subfiles with preset name 1`] = ` Object { "packageName": "some/repo", "params": undefined, @@ -142,7 +142,7 @@ Object { } `; -exports[`config/presets parsePreset parses github toplevel file using subdirectory syntax 1`] = ` +exports[`config/presets/index parsePreset parses github toplevel file using subdirectory syntax 1`] = ` Object { "packageName": "some/repo", "params": undefined, @@ -152,7 +152,7 @@ Object { } `; -exports[`config/presets parsePreset parses gitlab 1`] = ` +exports[`config/presets/index parsePreset parses gitlab 1`] = ` Object { "packageName": "some/repo", "params": undefined, @@ -162,7 +162,7 @@ Object { } `; -exports[`config/presets parsePreset parses local 1`] = ` +exports[`config/presets/index parsePreset parses local 1`] = ` Object { "packageName": "some/repo", "params": undefined, @@ -172,7 +172,7 @@ Object { } `; -exports[`config/presets parsePreset parses local with subdirectory 1`] = ` +exports[`config/presets/index parsePreset parses local with subdirectory 1`] = ` Object { "packageName": "some-group/some-repo", "params": undefined, @@ -182,7 +182,7 @@ Object { } `; -exports[`config/presets parsePreset parses no prefix as local 1`] = ` +exports[`config/presets/index parsePreset parses no prefix as local 1`] = ` Object { "packageName": "some/repo", "params": undefined, @@ -192,7 +192,7 @@ Object { } `; -exports[`config/presets parsePreset returns default package name 1`] = ` +exports[`config/presets/index parsePreset returns default package name 1`] = ` Object { "packageName": "default", "params": undefined, @@ -202,7 +202,7 @@ Object { } `; -exports[`config/presets parsePreset returns default package name with params 1`] = ` +exports[`config/presets/index parsePreset returns default package name with params 1`] = ` Object { "packageName": "default", "params": Array [ @@ -215,7 +215,7 @@ Object { } `; -exports[`config/presets parsePreset returns non-scoped default 1`] = ` +exports[`config/presets/index parsePreset returns non-scoped default 1`] = ` Object { "packageName": "renovate-config-somepackage", "params": undefined, @@ -225,7 +225,7 @@ Object { } `; -exports[`config/presets parsePreset returns non-scoped package name 1`] = ` +exports[`config/presets/index parsePreset returns non-scoped package name 1`] = ` Object { "packageName": "renovate-config-somepackage", "params": undefined, @@ -235,7 +235,7 @@ Object { } `; -exports[`config/presets parsePreset returns non-scoped package name full 1`] = ` +exports[`config/presets/index parsePreset returns non-scoped package name full 1`] = ` Object { "packageName": "renovate-config-somepackage", "params": undefined, @@ -245,7 +245,7 @@ Object { } `; -exports[`config/presets parsePreset returns non-scoped package name with params 1`] = ` +exports[`config/presets/index parsePreset returns non-scoped package name with params 1`] = ` Object { "packageName": "renovate-config-somepackage", "params": Array [ @@ -257,7 +257,7 @@ Object { } `; -exports[`config/presets parsePreset returns scope with packageName and default 1`] = ` +exports[`config/presets/index parsePreset returns scope with packageName and default 1`] = ` Object { "packageName": "@somescope/somepackagename", "params": undefined, @@ -267,7 +267,7 @@ Object { } `; -exports[`config/presets parsePreset returns scope with packageName and params and default 1`] = ` +exports[`config/presets/index parsePreset returns scope with packageName and params and default 1`] = ` Object { "packageName": "@somescope/somepackagename", "params": Array [ @@ -281,7 +281,7 @@ Object { } `; -exports[`config/presets parsePreset returns scope with packageName and presetName 1`] = ` +exports[`config/presets/index parsePreset returns scope with packageName and presetName 1`] = ` Object { "packageName": "@somescope/somepackagename", "params": undefined, @@ -291,7 +291,7 @@ Object { } `; -exports[`config/presets parsePreset returns scope with packageName and presetName and params 1`] = ` +exports[`config/presets/index parsePreset returns scope with packageName and presetName and params 1`] = ` Object { "packageName": "@somescope/somepackagename", "params": Array [ @@ -304,7 +304,7 @@ Object { } `; -exports[`config/presets parsePreset returns scope with presetName 1`] = ` +exports[`config/presets/index parsePreset returns scope with presetName 1`] = ` Object { "packageName": "@somescope/renovate-config", "params": undefined, @@ -314,7 +314,7 @@ Object { } `; -exports[`config/presets parsePreset returns scope with presetName and params 1`] = ` +exports[`config/presets/index parsePreset returns scope with presetName and params 1`] = ` Object { "packageName": "@somescope/renovate-config", "params": Array [ @@ -326,7 +326,7 @@ Object { } `; -exports[`config/presets parsePreset returns simple scope 1`] = ` +exports[`config/presets/index parsePreset returns simple scope 1`] = ` Object { "packageName": "@somescope/renovate-config", "params": undefined, @@ -336,7 +336,7 @@ Object { } `; -exports[`config/presets parsePreset returns simple scope and params 1`] = ` +exports[`config/presets/index parsePreset returns simple scope and params 1`] = ` Object { "packageName": "@somescope/renovate-config", "params": Array [ @@ -348,9 +348,9 @@ Object { } `; -exports[`config/presets replaceArgs replaces args in strings 1`] = `"c foo ab"`; +exports[`config/presets/index replaceArgs replaces args in strings 1`] = `"c foo ab"`; -exports[`config/presets replaceArgs replaces arrays 1`] = ` +exports[`config/presets/index replaceArgs replaces arrays 1`] = ` Object { "foo": Array [ "a", @@ -362,7 +362,7 @@ Object { } `; -exports[`config/presets replaceArgs replaces objects 1`] = ` +exports[`config/presets/index replaceArgs replaces objects 1`] = ` Object { "bar": Object { "aaa": Object { @@ -374,7 +374,7 @@ Object { } `; -exports[`config/presets resolvePreset combines two package alls 1`] = ` +exports[`config/presets/index resolvePreset combines two package alls 1`] = ` Object { "matchPackageNames": Array [ "babel-eslint", @@ -387,9 +387,9 @@ Object { } `; -exports[`config/presets resolvePreset ignores presets 1`] = `Object {}`; +exports[`config/presets/index resolvePreset ignores presets 1`] = `Object {}`; -exports[`config/presets resolvePreset migrates automerge in presets 1`] = ` +exports[`config/presets/index resolvePreset migrates automerge in presets 1`] = ` Object { "automergeType": "pr", "branchPrefix": "renovate/", @@ -463,7 +463,7 @@ Object { } `; -exports[`config/presets resolvePreset resolves eslint 1`] = ` +exports[`config/presets/index resolvePreset resolves eslint 1`] = ` Object { "matchPackageNames": Array [ "babel-eslint", @@ -475,7 +475,7 @@ Object { } `; -exports[`config/presets resolvePreset resolves linters 1`] = ` +exports[`config/presets/index resolvePreset resolves linters 1`] = ` Object { "description": Array [ "All lint-related packages", @@ -497,7 +497,7 @@ Object { } `; -exports[`config/presets resolvePreset resolves nested groups 1`] = ` +exports[`config/presets/index resolvePreset resolves nested groups 1`] = ` Object { "description": Array [ "Update lint packages automatically if tests pass", @@ -527,7 +527,7 @@ Object { } `; -exports[`config/presets resolvePreset resolves packageRule 1`] = ` +exports[`config/presets/index resolvePreset resolves packageRule 1`] = ` Object { "packageRules": Array [ Object { @@ -544,7 +544,7 @@ Object { } `; -exports[`config/presets resolvePreset resolves self-hosted presets without baseConfig 1`] = ` +exports[`config/presets/index resolvePreset resolves self-hosted presets without baseConfig 1`] = ` Object { "labels": Array [ "self-hosted resolved", @@ -552,55 +552,55 @@ Object { } `; -exports[`config/presets resolvePreset returns same if no presets 1`] = ` +exports[`config/presets/index resolvePreset returns same if no presets 1`] = ` Object { "foo": 1, } `; -exports[`config/presets resolvePreset throws if invalid preset 1`] = `undefined`; +exports[`config/presets/index resolvePreset throws if invalid preset 1`] = `undefined`; -exports[`config/presets resolvePreset throws if invalid preset 2`] = `"Preset name not found within published preset config (wrongpreset:invalid-preset)"`; +exports[`config/presets/index resolvePreset throws if invalid preset 2`] = `"Preset name not found within published preset config (wrongpreset:invalid-preset)"`; -exports[`config/presets resolvePreset throws if invalid preset 3`] = `undefined`; +exports[`config/presets/index resolvePreset throws if invalid preset 3`] = `undefined`; -exports[`config/presets resolvePreset throws if invalid preset file 1`] = `undefined`; +exports[`config/presets/index resolvePreset throws if invalid preset file 1`] = `undefined`; -exports[`config/presets resolvePreset throws if invalid preset file 2`] = `"Cannot find preset's package (notfound)"`; +exports[`config/presets/index resolvePreset throws if invalid preset file 2`] = `"Cannot find preset's package (notfound)"`; -exports[`config/presets resolvePreset throws if invalid preset file 3`] = `undefined`; +exports[`config/presets/index resolvePreset throws if invalid preset file 3`] = `undefined`; -exports[`config/presets resolvePreset throws if path + invalid syntax 1`] = `undefined`; +exports[`config/presets/index resolvePreset throws if path + invalid syntax 1`] = `undefined`; -exports[`config/presets resolvePreset throws if path + invalid syntax 2`] = `"Preset is invalid (github>user/repo//)"`; +exports[`config/presets/index resolvePreset throws if path + invalid syntax 2`] = `"Preset is invalid (github>user/repo//)"`; -exports[`config/presets resolvePreset throws if path + invalid syntax 3`] = `undefined`; +exports[`config/presets/index resolvePreset throws if path + invalid syntax 3`] = `undefined`; -exports[`config/presets resolvePreset throws if path + sub-preset 1`] = `undefined`; +exports[`config/presets/index resolvePreset throws if path + sub-preset 1`] = `undefined`; -exports[`config/presets resolvePreset throws if path + sub-preset 2`] = `"Sub-presets cannot be combined with a custom path (github>user/repo//path:subpreset)"`; +exports[`config/presets/index resolvePreset throws if path + sub-preset 2`] = `"Sub-presets cannot be combined with a custom path (github>user/repo//path:subpreset)"`; -exports[`config/presets resolvePreset throws if path + sub-preset 3`] = `undefined`; +exports[`config/presets/index resolvePreset throws if path + sub-preset 3`] = `undefined`; -exports[`config/presets resolvePreset throws if valid and invalid 1`] = `undefined`; +exports[`config/presets/index resolvePreset throws if valid and invalid 1`] = `undefined`; -exports[`config/presets resolvePreset throws if valid and invalid 2`] = `"Preset name not found within published preset config (wrongpreset:invalid-preset)"`; +exports[`config/presets/index resolvePreset throws if valid and invalid 2`] = `"Preset name not found within published preset config (wrongpreset:invalid-preset)"`; -exports[`config/presets resolvePreset throws if valid and invalid 3`] = `undefined`; +exports[`config/presets/index resolvePreset throws if valid and invalid 3`] = `undefined`; -exports[`config/presets resolvePreset throws noconfig 1`] = `undefined`; +exports[`config/presets/index resolvePreset throws noconfig 1`] = `undefined`; -exports[`config/presets resolvePreset throws noconfig 2`] = `"Preset package is missing a renovate-config entry (noconfig:base)"`; +exports[`config/presets/index resolvePreset throws noconfig 2`] = `"Preset package is missing a renovate-config entry (noconfig:base)"`; -exports[`config/presets resolvePreset throws noconfig 3`] = `undefined`; +exports[`config/presets/index resolvePreset throws noconfig 3`] = `undefined`; -exports[`config/presets resolvePreset throws throw 1`] = `undefined`; +exports[`config/presets/index resolvePreset throws throw 1`] = `undefined`; -exports[`config/presets resolvePreset throws throw 2`] = `undefined`; +exports[`config/presets/index resolvePreset throws throw 2`] = `undefined`; -exports[`config/presets resolvePreset throws throw 3`] = `undefined`; +exports[`config/presets/index resolvePreset throws throw 3`] = `undefined`; -exports[`config/presets resolvePreset works with valid 1`] = ` +exports[`config/presets/index resolvePreset works with valid 1`] = ` Object { "foo": 1, "ignoreDeps": Array [], diff --git a/lib/config/presets/index.spec.ts b/lib/config/presets/index.spec.ts index 42e573920a..4b829c7ed6 100644 --- a/lib/config/presets/index.spec.ts +++ b/lib/config/presets/index.spec.ts @@ -1,5 +1,5 @@ import { RenovateConfig } from '..'; -import { mocked } from '../../../test/util'; +import { getName, mocked } from '../../../test/util'; import presetIkatyang from './__fixtures__/renovate-config-ikatyang.json'; import * as _local from './local'; import * as _npm from './npm'; @@ -33,7 +33,7 @@ npm.getPreset = jest.fn(({ packageName, presetName }) => { return null; }); -describe('config/presets', () => { +describe(getName(__filename), () => { 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 dc56f96a4b..b58b51b3a1 100644 --- a/lib/config/presets/internal/index.spec.ts +++ b/lib/config/presets/internal/index.spec.ts @@ -1,4 +1,4 @@ -import { mocked } from '../../../../test/util'; +import { getName, mocked } from '../../../../test/util'; import { CONFIG_VALIDATION } from '../../../constants/error-messages'; import { massageConfig } from '../../massage'; import { validateConfig } from '../../validation'; @@ -14,7 +14,7 @@ npm.getPreset = jest.fn((_) => null); const ignoredPresets = ['default:group', 'default:timezone']; -describe('config/presets/internal', () => { +describe(getName(__filename), () => { it('fails for undefined internal preset', async () => { const preset = 'foo:bar'; const presetConfig = { extends: [preset] }; diff --git a/lib/config/presets/npm/__snapshots__/index.spec.ts.snap b/lib/config/presets/npm/__snapshots__/index.spec.ts.snap index eb67bf320a..b4544d12eb 100644 --- a/lib/config/presets/npm/__snapshots__/index.spec.ts.snap +++ b/lib/config/presets/npm/__snapshots__/index.spec.ts.snap @@ -1,6 +1,6 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP -exports[`config/presets/npm should return preset 1`] = ` +exports[`config/presets/npm/index should return preset 1`] = ` Object { "rangeStrategy": "auto", } diff --git a/lib/config/presets/npm/index.spec.ts b/lib/config/presets/npm/index.spec.ts index 8cd3601638..931ae3d39d 100644 --- a/lib/config/presets/npm/index.spec.ts +++ b/lib/config/presets/npm/index.spec.ts @@ -1,11 +1,12 @@ import nock from 'nock'; +import { getName } from '../../../../test/util'; import { setAdminConfig } from '../../admin'; import * as npm from '.'; jest.mock('registry-auth-token'); jest.mock('delay'); -describe('config/presets/npm', () => { +describe(getName(__filename), () => { delete process.env.NPM_TOKEN; beforeEach(() => { jest.resetAllMocks(); diff --git a/lib/config/validation.spec.ts b/lib/config/validation.spec.ts index b7a3aa8ae7..a8ddf051b3 100644 --- a/lib/config/validation.spec.ts +++ b/lib/config/validation.spec.ts @@ -1,7 +1,8 @@ +import { getName } from '../../test/util'; import * as configValidation from './validation'; import { RenovateConfig } from '.'; -describe('config/validation', () => { +describe(getName(__filename), () => { describe('getParentName()', () => { it('ignores encrypted in root', () => { expect(configValidation.getParentName('encrypted')).toEqual(''); diff --git a/lib/logger/config-serializer.spec.ts b/lib/logger/config-serializer.spec.ts index d3079b2b5d..35472ec770 100644 --- a/lib/logger/config-serializer.spec.ts +++ b/lib/logger/config-serializer.spec.ts @@ -1,6 +1,7 @@ +import { getName } from '../../test/util'; import configSerializer from './config-serializer'; -describe('logger/config-serializer', () => { +describe(getName(__filename), () => { it('squashes templates', () => { const config = { nottoken: 'b', diff --git a/lib/logger/err-serializer.spec.ts b/lib/logger/err-serializer.spec.ts index 2e1ed2a052..bc9e775c3a 100644 --- a/lib/logger/err-serializer.spec.ts +++ b/lib/logger/err-serializer.spec.ts @@ -1,11 +1,11 @@ import * as httpMock from '../../test/http-mock'; -import { partial } from '../../test/util'; +import { getName, partial } from '../../test/util'; import * as hostRules from '../util/host-rules'; import { Http } from '../util/http'; import errSerializer from './err-serializer'; import { sanitizeValue } from './utils'; -describe('logger/err-serializer', () => { +describe(getName(__filename), () => { it('expands errors', () => { const err = partial<Error & Record<string, unknown>>({ a: 1, diff --git a/lib/logger/pretty-stdout.spec.ts b/lib/logger/pretty-stdout.spec.ts index bf335f5686..21a48e4809 100644 --- a/lib/logger/pretty-stdout.spec.ts +++ b/lib/logger/pretty-stdout.spec.ts @@ -1,4 +1,5 @@ import chalk from 'chalk'; +import { getName } from '../../test/util'; import * as prettyStdout from './pretty-stdout'; import type { BunyanRecord } from './utils'; @@ -9,7 +10,7 @@ jest.mock('chalk', () => ) ); -describe('logger/pretty-stdout', () => { +describe(getName(__filename), () => { describe('getMeta(rec)', () => { it('returns empty string if null rec', () => { expect(prettyStdout.getMeta(null as any)).toEqual(''); diff --git a/lib/platform/azure/__snapshots__/azure-helper.spec.ts.snap b/lib/platform/azure/__snapshots__/azure-helper.spec.ts.snap index 86f7b3e499..2cc4a32e24 100644 --- a/lib/platform/azure/__snapshots__/azure-helper.spec.ts.snap +++ b/lib/platform/azure/__snapshots__/azure-helper.spec.ts.snap @@ -1,20 +1,20 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP -exports[`platform/azure/helpers getAzureBranchObj should get the branch object 1`] = ` +exports[`platform/azure/azure-helper getAzureBranchObj should get the branch object 1`] = ` Object { "name": "refs/heads/branchName", "oldObjectId": "132", } `; -exports[`platform/azure/helpers getAzureBranchObj should get the branch object when ref missing 1`] = ` +exports[`platform/azure/azure-helper getAzureBranchObj should get the branch object when ref missing 1`] = ` Object { "name": "refs/heads/branchName", "oldObjectId": "0000000000000000000000000000000000000000", } `; -exports[`platform/azure/helpers getCommitDetails should get commit details 1`] = ` +exports[`platform/azure/azure-helper getCommitDetails should get commit details 1`] = ` Object { "parents": Array [ "123456", @@ -22,9 +22,9 @@ Object { } `; -exports[`platform/azure/helpers getFile should return the file content because it is not a json 1`] = `"{\\"hello\\"= \\"test\\"}"`; +exports[`platform/azure/azure-helper getFile should return the file content because it is not a json 1`] = `"{\\"hello\\"= \\"test\\"}"`; -exports[`platform/azure/helpers getRef should get the ref with full ref name 1`] = ` +exports[`platform/azure/azure-helper getRef should get the ref with full ref name 1`] = ` Array [ Object { "objectId": "132", @@ -32,7 +32,7 @@ Array [ ] `; -exports[`platform/azure/helpers getRef should get the ref with short ref name 1`] = ` +exports[`platform/azure/azure-helper getRef should get the ref with short ref name 1`] = ` Array [ Object { "objectId": 132, diff --git a/lib/platform/azure/__snapshots__/index.spec.ts.snap b/lib/platform/azure/__snapshots__/index.spec.ts.snap index f086e94fa4..8616755105 100644 --- a/lib/platform/azure/__snapshots__/index.spec.ts.snap +++ b/lib/platform/azure/__snapshots__/index.spec.ts.snap @@ -1,6 +1,6 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP -exports[`platform/azure createPr() should create and return a PR object 1`] = ` +exports[`platform/azure/index createPr() should create and return a PR object 1`] = ` Object { "body": undefined, "createdAt": undefined, @@ -14,7 +14,7 @@ Object { } `; -exports[`platform/azure createPr() should create and return a PR object from base branch 1`] = ` +exports[`platform/azure/index createPr() should create and return a PR object from base branch 1`] = ` Object { "body": undefined, "createdAt": undefined, @@ -28,7 +28,7 @@ Object { } `; -exports[`platform/azure createPr() should create and return a PR object with auto-complete set 1`] = ` +exports[`platform/azure/index createPr() should create and return a PR object with auto-complete set 1`] = ` Object { "autoCompleteSetBy": Object { "id": 123, @@ -52,14 +52,14 @@ Object { } `; -exports[`platform/azure deleteLabel() Should delete a label 1`] = ` +exports[`platform/azure/index deleteLabel() Should delete a label 1`] = ` Array [ Array [], Array [], ] `; -exports[`platform/azure ensureComment adds comment if missing 1`] = ` +exports[`platform/azure/index ensureComment adds comment if missing 1`] = ` Array [ Array [ Object { @@ -81,19 +81,19 @@ content", ] `; -exports[`platform/azure ensureComment adds comment if missing 2`] = `Array []`; +exports[`platform/azure/index ensureComment adds comment if missing 2`] = `Array []`; -exports[`platform/azure ensureComment does nothing if comment exists and is the same 1`] = `Array []`; +exports[`platform/azure/index ensureComment does nothing if comment exists and is the same 1`] = `Array []`; -exports[`platform/azure ensureComment does nothing if comment exists and is the same 2`] = `Array []`; +exports[`platform/azure/index ensureComment does nothing if comment exists and is the same 2`] = `Array []`; -exports[`platform/azure ensureComment does nothing if comment exists and is the same when there is no topic 1`] = `Array []`; +exports[`platform/azure/index ensureComment does nothing if comment exists and is the same when there is no topic 1`] = `Array []`; -exports[`platform/azure ensureComment does nothing if comment exists and is the same when there is no topic 2`] = `Array []`; +exports[`platform/azure/index ensureComment does nothing if comment exists and is the same when there is no topic 2`] = `Array []`; -exports[`platform/azure ensureComment updates comment if missing 1`] = `Array []`; +exports[`platform/azure/index ensureComment updates comment if missing 1`] = `Array []`; -exports[`platform/azure ensureComment updates comment if missing 2`] = ` +exports[`platform/azure/index ensureComment updates comment if missing 2`] = ` Array [ Array [ Object { @@ -111,7 +111,7 @@ content", ] `; -exports[`platform/azure findPr(branchName, prTitle, state) returns pr if found it all state 1`] = ` +exports[`platform/azure/index findPr(branchName, prTitle, state) returns pr if found it all state 1`] = ` Object { "body": undefined, "createdAt": undefined, @@ -128,7 +128,7 @@ Object { } `; -exports[`platform/azure findPr(branchName, prTitle, state) returns pr if found it close 1`] = ` +exports[`platform/azure/index findPr(branchName, prTitle, state) returns pr if found it close 1`] = ` Object { "body": undefined, "createdAt": undefined, @@ -145,7 +145,7 @@ Object { } `; -exports[`platform/azure findPr(branchName, prTitle, state) returns pr if found it open 1`] = ` +exports[`platform/azure/index findPr(branchName, prTitle, state) returns pr if found it open 1`] = ` Object { "body": undefined, "createdAt": undefined, @@ -162,7 +162,7 @@ Object { } `; -exports[`platform/azure findPr(branchName, prTitle, state) returns pr if found not open 1`] = ` +exports[`platform/azure/index findPr(branchName, prTitle, state) returns pr if found not open 1`] = ` Object { "body": undefined, "createdAt": undefined, @@ -179,9 +179,9 @@ Object { } `; -exports[`platform/azure getBranchPr(branchName) should return the pr 1`] = `null`; +exports[`platform/azure/index getBranchPr(branchName) should return the pr 1`] = `null`; -exports[`platform/azure getJsonFile() supports fetch from another repo 1`] = ` +exports[`platform/azure/index getJsonFile() supports fetch from another repo 1`] = ` Array [ Array [ "123456", @@ -190,7 +190,7 @@ Array [ ] `; -exports[`platform/azure getPr(prNo) should return a pr in the right format 1`] = ` +exports[`platform/azure/index getPr(prNo) should return a pr in the right format 1`] = ` Object { "body": undefined, "createdAt": undefined, @@ -208,41 +208,41 @@ Object { } `; -exports[`platform/azure getRepos() should return an array of repos 1`] = ` +exports[`platform/azure/index getRepos() should return an array of repos 1`] = ` Array [ Array [], ] `; -exports[`platform/azure getRepos() should return an array of repos 2`] = ` +exports[`platform/azure/index getRepos() should return an array of repos 2`] = ` Array [ "prj1/repo1", "prj1/repo2", ] `; -exports[`platform/azure initPlatform() should init 1`] = ` +exports[`platform/azure/index initPlatform() should init 1`] = ` Object { "endpoint": "https://dev.azure.com/renovate12345/", } `; -exports[`platform/azure initRepo should initialise the config for a repo 1`] = ` +exports[`platform/azure/index initRepo should initialise the config for a repo 1`] = ` Array [ Array [], ] `; -exports[`platform/azure initRepo should initialise the config for a repo 2`] = ` +exports[`platform/azure/index initRepo should initialise the config for a repo 2`] = ` Object { "defaultBranch": "defBr", "isFork": false, } `; -exports[`platform/azure massageMarkdown(input) returns updated pr body 1`] = `"https://github.com/foo/bar/issues/5 plus also [a link](https://github.com/foo/bar/issues/5)"`; +exports[`platform/azure/index massageMarkdown(input) returns updated pr body 1`] = `"https://github.com/foo/bar/issues/5 plus also [a link](https://github.com/foo/bar/issues/5)"`; -exports[`platform/azure updatePr(prNo, title, body) should close the PR 1`] = ` +exports[`platform/azure/index updatePr(prNo, title, body) should close the PR 1`] = ` Array [ Array [ Object { @@ -256,7 +256,7 @@ Array [ ] `; -exports[`platform/azure updatePr(prNo, title, body) should reopen the PR 1`] = ` +exports[`platform/azure/index updatePr(prNo, title, body) should reopen the PR 1`] = ` Array [ Array [ Object { @@ -276,7 +276,7 @@ Array [ ] `; -exports[`platform/azure updatePr(prNo, title, body) should update the PR 1`] = ` +exports[`platform/azure/index updatePr(prNo, title, body) should update the PR 1`] = ` Array [ Array [ Object { @@ -289,7 +289,7 @@ Array [ ] `; -exports[`platform/azure updatePr(prNo, title, body) should update the PR without description 1`] = ` +exports[`platform/azure/index updatePr(prNo, title, body) should update the PR without description 1`] = ` Array [ Array [ Object { diff --git a/lib/platform/azure/__snapshots__/util.spec.ts.snap b/lib/platform/azure/__snapshots__/util.spec.ts.snap index fbee393907..0e46c62728 100644 --- a/lib/platform/azure/__snapshots__/util.spec.ts.snap +++ b/lib/platform/azure/__snapshots__/util.spec.ts.snap @@ -1,20 +1,20 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP -exports[`platform/azure/helpers getProjectAndRepo should return the object with project and repo 1`] = ` +exports[`platform/azure/util getProjectAndRepo should return the object with project and repo 1`] = ` Object { "project": "prjName", "repo": "myRepoName", } `; -exports[`platform/azure/helpers getProjectAndRepo should return the object with same strings 1`] = ` +exports[`platform/azure/util getProjectAndRepo should return the object with same strings 1`] = ` Object { "project": "myRepoName", "repo": "myRepoName", } `; -exports[`platform/azure/helpers getRenovatePRFormat should be formated (closed v2) 1`] = ` +exports[`platform/azure/util getRenovatePRFormat should be formated (closed v2) 1`] = ` Object { "body": undefined, "createdAt": undefined, @@ -28,7 +28,7 @@ Object { } `; -exports[`platform/azure/helpers getRenovatePRFormat should be formated (closed) 1`] = ` +exports[`platform/azure/util getRenovatePRFormat should be formated (closed) 1`] = ` Object { "body": undefined, "createdAt": undefined, @@ -42,7 +42,7 @@ Object { } `; -exports[`platform/azure/helpers getRenovatePRFormat should be formated (isConflicted) 1`] = ` +exports[`platform/azure/util getRenovatePRFormat should be formated (isConflicted) 1`] = ` Object { "body": undefined, "createdAt": undefined, @@ -57,7 +57,7 @@ Object { } `; -exports[`platform/azure/helpers getRenovatePRFormat should be formated (not closed) 1`] = ` +exports[`platform/azure/util getRenovatePRFormat should be formated (not closed) 1`] = ` Object { "body": undefined, "createdAt": undefined, @@ -71,22 +71,22 @@ Object { } `; -exports[`platform/azure/helpers getStorageExtraCloneOpts should configure basic auth 1`] = ` +exports[`platform/azure/util getStorageExtraCloneOpts should configure basic auth 1`] = ` Object { "-c": "http.extraheader=AUTHORIZATION: basic dXNlcjpwYXNz", } `; -exports[`platform/azure/helpers getStorageExtraCloneOpts should configure bearer token 1`] = ` +exports[`platform/azure/util getStorageExtraCloneOpts should configure bearer token 1`] = ` Object { "-c": "http.extraheader=AUTHORIZATION: bearer token", } `; -exports[`platform/azure/helpers getStorageExtraCloneOpts should configure personal access token 1`] = ` +exports[`platform/azure/util getStorageExtraCloneOpts should configure personal access token 1`] = ` Object { "-c": "http.extraheader=AUTHORIZATION: basic OjEyMzQ1Njc4OTAxMjM0NTY3ODkwMTIzNDU2Nzg5MDEyMzQ1Njc4OTAxMjM0NTY3ODkwMTI=", } `; -exports[`platform/azure/helpers max4000Chars should be the same 1`] = `"Hello"`; +exports[`platform/azure/util max4000Chars should be the same 1`] = `"Hello"`; diff --git a/lib/platform/azure/azure-got-wrapper.spec.ts b/lib/platform/azure/azure-got-wrapper.spec.ts index 79d88828d7..e00051beca 100644 --- a/lib/platform/azure/azure-got-wrapper.spec.ts +++ b/lib/platform/azure/azure-got-wrapper.spec.ts @@ -1,7 +1,8 @@ +import { getName } from '../../../test/util'; import { PLATFORM_TYPE_AZURE } from '../../constants/platforms'; import * as _hostRules from '../../util/host-rules'; -describe('platform/azure/azure-got-wrapper', () => { +describe(getName(__filename), () => { 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 e6988efa80..dd6bf34ebd 100644 --- a/lib/platform/azure/azure-helper.spec.ts +++ b/lib/platform/azure/azure-helper.spec.ts @@ -1,7 +1,8 @@ import { Readable } from 'stream'; import { GitPullRequestMergeStrategy } from 'azure-devops-node-api/interfaces/GitInterfaces'; +import { getName } from '../../../test/util'; -describe('platform/azure/helpers', () => { +describe(getName(__filename), () => { let azureHelper: typeof import('./azure-helper'); let azureApi: jest.Mocked<typeof import('./azure-got-wrapper')>; diff --git a/lib/platform/azure/index.spec.ts b/lib/platform/azure/index.spec.ts index 7c18b91d80..ce063598ae 100644 --- a/lib/platform/azure/index.spec.ts +++ b/lib/platform/azure/index.spec.ts @@ -5,13 +5,14 @@ import { GitStatusState, PullRequestStatus, } from 'azure-devops-node-api/interfaces/GitInterfaces'; +import { getName } from '../../../test/util'; import { logger as _logger } from '../../logger'; import { BranchStatus, PrState } from '../../types'; import * as _git from '../../util/git'; import * as _hostRules from '../../util/host-rules'; import type { Platform, RepoParams } from '../types'; -describe('platform/azure', () => { +describe(getName(__filename), () => { let hostRules: jest.Mocked<typeof _hostRules>; let azure: Platform; let azureApi: jest.Mocked<typeof import('./azure-got-wrapper')>; diff --git a/lib/platform/azure/util.spec.ts b/lib/platform/azure/util.spec.ts index c816ea2229..92f1270a1f 100644 --- a/lib/platform/azure/util.spec.ts +++ b/lib/platform/azure/util.spec.ts @@ -1,4 +1,5 @@ import { Readable } from 'stream'; +import { getName } from '../../../test/util'; import { getBranchNameWithoutRefsheadsPrefix, getGitStatusContextCombinedName, @@ -12,7 +13,7 @@ import { streamToString, } from './util'; -describe('platform/azure/helpers', () => { +describe(getName(__filename), () => { describe('getNewBranchName', () => { it('should add refs/heads', () => { const res = getNewBranchName('testBB'); diff --git a/lib/platform/bitbucket/__snapshots__/index.spec.ts.snap b/lib/platform/bitbucket/__snapshots__/index.spec.ts.snap index c7ee7e74d2..45b8e81ab4 100644 --- a/lib/platform/bitbucket/__snapshots__/index.spec.ts.snap +++ b/lib/platform/bitbucket/__snapshots__/index.spec.ts.snap @@ -1,8 +1,8 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP -exports[`platform/bitbucket addAssignees() does not throw 1`] = `undefined`; +exports[`platform/bitbucket/index addAssignees() does not throw 1`] = `undefined`; -exports[`platform/bitbucket addReviewers should add the given reviewers to the PR 1`] = ` +exports[`platform/bitbucket/index addReviewers should add the given reviewers to the PR 1`] = ` Array [ Object { "headers": Object { @@ -53,7 +53,7 @@ Array [ ] `; -exports[`platform/bitbucket createPr() posts PR 1`] = ` +exports[`platform/bitbucket/index createPr() posts PR 1`] = ` Array [ Object { "headers": Object { @@ -94,11 +94,11 @@ Array [ ] `; -exports[`platform/bitbucket ensureComment() does not throw 1`] = `false`; +exports[`platform/bitbucket/index ensureComment() does not throw 1`] = `false`; -exports[`platform/bitbucket ensureCommentRemoval() does not throw 1`] = `undefined`; +exports[`platform/bitbucket/index ensureCommentRemoval() does not throw 1`] = `undefined`; -exports[`platform/bitbucket ensureIssue() creates new issue 1`] = ` +exports[`platform/bitbucket/index ensureIssue() creates new issue 1`] = ` Array [ Object { "headers": Object { @@ -150,7 +150,7 @@ Array [ ] `; -exports[`platform/bitbucket ensureIssue() noop for existing issue 1`] = ` +exports[`platform/bitbucket/index ensureIssue() noop for existing issue 1`] = ` Array [ Object { "headers": Object { @@ -191,7 +191,7 @@ Array [ ] `; -exports[`platform/bitbucket ensureIssue() updates existing issues 1`] = ` +exports[`platform/bitbucket/index ensureIssue() updates existing issues 1`] = ` Array [ Object { "headers": Object { @@ -246,7 +246,7 @@ Array [ ] `; -exports[`platform/bitbucket ensureIssueClosing() closes issue 1`] = ` +exports[`platform/bitbucket/index ensureIssueClosing() closes issue 1`] = ` Array [ Object { "headers": Object { @@ -301,7 +301,7 @@ Array [ ] `; -exports[`platform/bitbucket ensureIssueClosing() does not throw 1`] = ` +exports[`platform/bitbucket/index ensureIssueClosing() does not throw 1`] = ` Array [ Object { "headers": Object { @@ -317,14 +317,14 @@ Array [ ] `; -exports[`platform/bitbucket findIssue() does not throw 1`] = ` +exports[`platform/bitbucket/index findIssue() does not throw 1`] = ` Object { "body": "content", "number": 25, } `; -exports[`platform/bitbucket findIssue() does not throw 2`] = ` +exports[`platform/bitbucket/index findIssue() does not throw 2`] = ` Array [ Object { "headers": Object { @@ -351,7 +351,7 @@ Array [ ] `; -exports[`platform/bitbucket findIssue() returns null if no issues 1`] = ` +exports[`platform/bitbucket/index findIssue() returns null if no issues 1`] = ` Array [ Object { "headers": Object { @@ -378,7 +378,7 @@ Array [ ] `; -exports[`platform/bitbucket findPr() finds pr 1`] = ` +exports[`platform/bitbucket/index findPr() finds pr 1`] = ` Object { "body": "summary", "createdAt": "2018-07-02T07:02:25.275030+00:00", @@ -390,7 +390,7 @@ Object { } `; -exports[`platform/bitbucket findPr() finds pr 2`] = ` +exports[`platform/bitbucket/index findPr() finds pr 2`] = ` Array [ Object { "headers": Object { @@ -417,7 +417,7 @@ Array [ ] `; -exports[`platform/bitbucket getBranchPr() bitbucket finds PR for branch 1`] = ` +exports[`platform/bitbucket/index getBranchPr() bitbucket finds PR for branch 1`] = ` Object { "body": "summary", "canMerge": true, @@ -433,7 +433,7 @@ Object { } `; -exports[`platform/bitbucket getBranchPr() bitbucket finds PR for branch 2`] = ` +exports[`platform/bitbucket/index getBranchPr() bitbucket finds PR for branch 2`] = ` Array [ Object { "headers": Object { @@ -481,7 +481,7 @@ Array [ ] `; -exports[`platform/bitbucket getBranchPr() returns null if no PR for branch 1`] = ` +exports[`platform/bitbucket/index getBranchPr() returns null if no PR for branch 1`] = ` Array [ Object { "headers": Object { @@ -508,7 +508,7 @@ Array [ ] `; -exports[`platform/bitbucket getBranchStatus() getBranchStatus 1 1`] = ` +exports[`platform/bitbucket/index getBranchStatus() getBranchStatus 1 1`] = ` Array [ Object { "headers": Object { @@ -524,7 +524,7 @@ Array [ ] `; -exports[`platform/bitbucket getBranchStatus() getBranchStatus 2 1`] = ` +exports[`platform/bitbucket/index getBranchStatus() getBranchStatus 2 1`] = ` Array [ Object { "headers": Object { @@ -540,7 +540,7 @@ Array [ ] `; -exports[`platform/bitbucket getBranchStatus() getBranchStatus 3 1`] = ` +exports[`platform/bitbucket/index getBranchStatus() getBranchStatus 3 1`] = ` Array [ Object { "headers": Object { @@ -578,7 +578,7 @@ Array [ ] `; -exports[`platform/bitbucket getBranchStatus() getBranchStatus 4 1`] = ` +exports[`platform/bitbucket/index getBranchStatus() getBranchStatus 4 1`] = ` Array [ Object { "headers": Object { @@ -616,7 +616,7 @@ Array [ ] `; -exports[`platform/bitbucket getBranchStatus() getBranchStatus 5 1`] = ` +exports[`platform/bitbucket/index getBranchStatus() getBranchStatus 5 1`] = ` Array [ Object { "headers": Object { @@ -654,7 +654,7 @@ Array [ ] `; -exports[`platform/bitbucket getBranchStatus() getBranchStatus 6 1`] = ` +exports[`platform/bitbucket/index getBranchStatus() getBranchStatus 6 1`] = ` Array [ Object { "headers": Object { @@ -692,7 +692,7 @@ Array [ ] `; -exports[`platform/bitbucket getBranchStatusCheck() getBranchStatusCheck 1 1`] = ` +exports[`platform/bitbucket/index getBranchStatusCheck() getBranchStatusCheck 1 1`] = ` Array [ Object { "headers": Object { @@ -730,7 +730,7 @@ Array [ ] `; -exports[`platform/bitbucket getBranchStatusCheck() getBranchStatusCheck 2 1`] = ` +exports[`platform/bitbucket/index getBranchStatusCheck() getBranchStatusCheck 2 1`] = ` Array [ Object { "headers": Object { @@ -768,7 +768,7 @@ Array [ ] `; -exports[`platform/bitbucket getBranchStatusCheck() getBranchStatusCheck 3 1`] = ` +exports[`platform/bitbucket/index getBranchStatusCheck() getBranchStatusCheck 3 1`] = ` Array [ Object { "headers": Object { @@ -806,7 +806,7 @@ Array [ ] `; -exports[`platform/bitbucket getIssueList() does not throw 1`] = ` +exports[`platform/bitbucket/index getIssueList() does not throw 1`] = ` Array [ Object { "headers": Object { @@ -833,7 +833,7 @@ Array [ ] `; -exports[`platform/bitbucket getIssueList() get issues 1`] = ` +exports[`platform/bitbucket/index getIssueList() get issues 1`] = ` Array [ Object { "headers": Object { @@ -860,7 +860,7 @@ Array [ ] `; -exports[`platform/bitbucket getIssueList() get issues 2`] = ` +exports[`platform/bitbucket/index getIssueList() get issues 2`] = ` Array [ Object { "content": Object { @@ -879,7 +879,7 @@ Array [ ] `; -exports[`platform/bitbucket getIssueList() has no issues 1`] = ` +exports[`platform/bitbucket/index getIssueList() has no issues 1`] = ` Array [ Object { "headers": Object { @@ -895,7 +895,7 @@ Array [ ] `; -exports[`platform/bitbucket getJsonFile() returns file content 1`] = ` +exports[`platform/bitbucket/index getJsonFile() returns file content 1`] = ` Array [ Object { "headers": Object { @@ -921,7 +921,7 @@ Array [ ] `; -exports[`platform/bitbucket getJsonFile() throws on errors 1`] = ` +exports[`platform/bitbucket/index getJsonFile() throws on errors 1`] = ` Array [ Object { "headers": Object { @@ -947,7 +947,7 @@ Array [ ] `; -exports[`platform/bitbucket getJsonFile() throws on malformed JSON 1`] = ` +exports[`platform/bitbucket/index getJsonFile() throws on malformed JSON 1`] = ` Array [ Object { "headers": Object { @@ -973,7 +973,7 @@ Array [ ] `; -exports[`platform/bitbucket getPr() canRebase 1`] = ` +exports[`platform/bitbucket/index getPr() canRebase 1`] = ` Object { "body": "summary", "canMerge": true, @@ -989,7 +989,7 @@ Object { } `; -exports[`platform/bitbucket getPr() canRebase 2`] = ` +exports[`platform/bitbucket/index getPr() canRebase 2`] = ` Object { "body": "summary", "canMerge": true, @@ -1005,7 +1005,7 @@ Object { } `; -exports[`platform/bitbucket getPr() canRebase 3`] = ` +exports[`platform/bitbucket/index getPr() canRebase 3`] = ` Object { "body": "summary", "canMerge": true, @@ -1021,7 +1021,7 @@ Object { } `; -exports[`platform/bitbucket getPr() canRebase 4`] = ` +exports[`platform/bitbucket/index getPr() canRebase 4`] = ` Array [ Object { "headers": Object { @@ -1100,7 +1100,7 @@ Array [ ] `; -exports[`platform/bitbucket getPr() exists 1`] = ` +exports[`platform/bitbucket/index getPr() exists 1`] = ` Object { "body": "summary", "canMerge": true, @@ -1116,7 +1116,7 @@ Object { } `; -exports[`platform/bitbucket getPr() exists 2`] = ` +exports[`platform/bitbucket/index getPr() exists 2`] = ` Array [ Object { "headers": Object { @@ -1153,7 +1153,7 @@ Array [ ] `; -exports[`platform/bitbucket getPrList() filters PR list by author 1`] = ` +exports[`platform/bitbucket/index getPrList() filters PR list by author 1`] = ` Array [ Object { "body": undefined, @@ -1167,7 +1167,7 @@ Array [ ] `; -exports[`platform/bitbucket getPrList() filters PR list by author 2`] = ` +exports[`platform/bitbucket/index getPrList() filters PR list by author 2`] = ` Array [ Object { "headers": Object { @@ -1205,7 +1205,7 @@ Array [ ] `; -exports[`platform/bitbucket getRepos() returns repos 1`] = ` +exports[`platform/bitbucket/index getRepos() returns repos 1`] = ` Array [ Object { "headers": Object { @@ -1221,20 +1221,20 @@ Array [ ] `; -exports[`platform/bitbucket initPlatform() should init 1`] = ` +exports[`platform/bitbucket/index initPlatform() should init 1`] = ` Object { "endpoint": "https://api.bitbucket.org/", } `; -exports[`platform/bitbucket initRepo() works 1`] = ` +exports[`platform/bitbucket/index initRepo() works 1`] = ` Object { "defaultBranch": "master", "isFork": false, } `; -exports[`platform/bitbucket initRepo() works 2`] = ` +exports[`platform/bitbucket/index initRepo() works 2`] = ` Array [ Object { "headers": Object { @@ -1250,9 +1250,9 @@ Array [ ] `; -exports[`platform/bitbucket massageMarkdown() returns diff files 1`] = `"**foo**bartext"`; +exports[`platform/bitbucket/index massageMarkdown() returns diff files 1`] = `"**foo**bartext"`; -exports[`platform/bitbucket mergePr() posts Merge 1`] = ` +exports[`platform/bitbucket/index mergePr() posts Merge 1`] = ` Array [ Object { "headers": Object { @@ -1282,7 +1282,7 @@ Array [ ] `; -exports[`platform/bitbucket setBranchStatus() posts status 1`] = ` +exports[`platform/bitbucket/index setBranchStatus() posts status 1`] = ` Array [ Object { "headers": Object { @@ -1345,7 +1345,7 @@ Array [ ] `; -exports[`platform/bitbucket updatePr() closes PR 1`] = ` +exports[`platform/bitbucket/index updatePr() closes PR 1`] = ` Array [ Object { "headers": Object { @@ -1397,7 +1397,7 @@ Array [ ] `; -exports[`platform/bitbucket updatePr() puts PR 1`] = ` +exports[`platform/bitbucket/index updatePr() puts PR 1`] = ` Array [ Object { "headers": Object { @@ -1438,9 +1438,9 @@ Array [ ] `; -exports[`platform/bitbucket updatePr() throws an error on failure to get current list of reviewers 1`] = `"Response code 500 (Internal Server Error)"`; +exports[`platform/bitbucket/index updatePr() throws an error on failure to get current list of reviewers 1`] = `"Response code 500 (Internal Server Error)"`; -exports[`platform/bitbucket updatePr() throws an error on failure to get current list of reviewers 2`] = ` +exports[`platform/bitbucket/index updatePr() throws an error on failure to get current list of reviewers 2`] = ` Array [ Object { "headers": Object { diff --git a/lib/platform/bitbucket/index.spec.ts b/lib/platform/bitbucket/index.spec.ts index 1df73fffd7..068232a229 100644 --- a/lib/platform/bitbucket/index.spec.ts +++ b/lib/platform/bitbucket/index.spec.ts @@ -1,5 +1,6 @@ import nock from 'nock'; import * as httpMock from '../../../test/http-mock'; +import { getName } from '../../../test/util'; import { logger as _logger } from '../../logger'; import { BranchStatus, PrState } from '../../types'; import * as _git from '../../util/git'; @@ -34,7 +35,7 @@ lxml==3.6.0 mccabe==0.6.1 `; -describe('platform/bitbucket', () => { +describe(getName(__filename), () => { let bitbucket: Platform; let hostRules: jest.Mocked<typeof import('../../util/host-rules')>; let git: jest.Mocked<typeof _git>; diff --git a/lib/platform/github/__snapshots__/index.spec.ts.snap b/lib/platform/github/__snapshots__/index.spec.ts.snap index 0e736cb3b3..cf435e4afb 100644 --- a/lib/platform/github/__snapshots__/index.spec.ts.snap +++ b/lib/platform/github/__snapshots__/index.spec.ts.snap @@ -1,6 +1,6 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP -exports[`platform/github addAssignees(issueNo, assignees) should add the given assignees to the issue 1`] = ` +exports[`platform/github/index addAssignees(issueNo, assignees) should add the given assignees to the issue 1`] = ` Array [ Object { "graphql": Object { @@ -54,7 +54,7 @@ Array [ ] `; -exports[`platform/github addReviewers(issueNo, reviewers) should add the given reviewers to the PR 1`] = ` +exports[`platform/github/index addReviewers(issueNo, reviewers) should add the given reviewers to the PR 1`] = ` Array [ Object { "graphql": Object { @@ -108,7 +108,7 @@ Array [ ] `; -exports[`platform/github createPr() should create a draftPR if set in the settings 1`] = ` +exports[`platform/github/index createPr() should create a draftPR if set in the settings 1`] = ` Object { "displayNumber": "Pull Request #123", "head": Object { @@ -122,7 +122,7 @@ Object { } `; -exports[`platform/github createPr() should create a draftPR if set in the settings 2`] = ` +exports[`platform/github/index createPr() should create a draftPR if set in the settings 2`] = ` Array [ Object { "graphql": Object { @@ -176,7 +176,7 @@ Array [ ] `; -exports[`platform/github createPr() should create and return a PR object 1`] = ` +exports[`platform/github/index createPr() should create and return a PR object 1`] = ` Object { "displayNumber": "Pull Request #123", "head": Object { @@ -190,7 +190,7 @@ Object { } `; -exports[`platform/github createPr() should create and return a PR object 2`] = ` +exports[`platform/github/index createPr() should create and return a PR object 2`] = ` Array [ Object { "graphql": Object { @@ -258,7 +258,7 @@ Array [ ] `; -exports[`platform/github createPr() should use defaultBranch 1`] = ` +exports[`platform/github/index createPr() should use defaultBranch 1`] = ` Object { "displayNumber": "Pull Request #123", "head": Object { @@ -272,7 +272,7 @@ Object { } `; -exports[`platform/github createPr() should use defaultBranch 2`] = ` +exports[`platform/github/index createPr() should use defaultBranch 2`] = ` Array [ Object { "graphql": Object { @@ -326,7 +326,7 @@ Array [ ] `; -exports[`platform/github deleteLabel(issueNo, label) should delete the label 1`] = ` +exports[`platform/github/index deleteLabel(issueNo, label) should delete the label 1`] = ` Array [ Object { "graphql": Object { @@ -377,7 +377,7 @@ Array [ ] `; -exports[`platform/github ensureComment add comment if not found 1`] = ` +exports[`platform/github/index ensureComment add comment if not found 1`] = ` Array [ Object { "graphql": Object { @@ -489,7 +489,7 @@ Array [ ] `; -exports[`platform/github ensureComment add updates comment if necessary 1`] = ` +exports[`platform/github/index ensureComment add updates comment if necessary 1`] = ` Array [ Object { "graphql": Object { @@ -601,7 +601,7 @@ Array [ ] `; -exports[`platform/github ensureComment adds comment if found in closed PR list 1`] = ` +exports[`platform/github/index ensureComment adds comment if found in closed PR list 1`] = ` Array [ Object { "graphql": Object { @@ -702,7 +702,7 @@ Array [ ] `; -exports[`platform/github ensureComment handles comment with no description 1`] = ` +exports[`platform/github/index ensureComment handles comment with no description 1`] = ` Array [ Object { "graphql": Object { @@ -800,7 +800,7 @@ Array [ ] `; -exports[`platform/github ensureComment skips comment 1`] = ` +exports[`platform/github/index ensureComment skips comment 1`] = ` Array [ Object { "graphql": Object { @@ -898,7 +898,7 @@ Array [ ] `; -exports[`platform/github ensureCommentRemoval deletes comment by content if found 1`] = ` +exports[`platform/github/index ensureCommentRemoval deletes comment by content if found 1`] = ` Array [ Object { "graphql": Object { @@ -1007,7 +1007,7 @@ Array [ ] `; -exports[`platform/github ensureCommentRemoval deletes comment by topic if found 1`] = ` +exports[`platform/github/index ensureCommentRemoval deletes comment by topic if found 1`] = ` Array [ Object { "graphql": Object { @@ -1116,7 +1116,7 @@ Array [ ] `; -exports[`platform/github ensureIssue() closes others if ensuring only once 1`] = ` +exports[`platform/github/index ensureIssue() closes others if ensuring only once 1`] = ` Array [ Object { "graphql": Object { @@ -1170,7 +1170,7 @@ Array [ ] `; -exports[`platform/github ensureIssue() creates issue 1`] = ` +exports[`platform/github/index ensureIssue() creates issue 1`] = ` Array [ Object { "graphql": Object { @@ -1227,7 +1227,7 @@ Array [ ] `; -exports[`platform/github ensureIssue() creates issue if not ensuring only once 1`] = ` +exports[`platform/github/index ensureIssue() creates issue if not ensuring only once 1`] = ` Array [ Object { "graphql": Object { @@ -1281,7 +1281,7 @@ Array [ ] `; -exports[`platform/github ensureIssue() creates issue if reopen flag false and issue is not open 1`] = ` +exports[`platform/github/index ensureIssue() creates issue if reopen flag false and issue is not open 1`] = ` Array [ Object { "graphql": Object { @@ -1349,7 +1349,7 @@ Array [ ] `; -exports[`platform/github ensureIssue() deletes if duplicate 1`] = ` +exports[`platform/github/index ensureIssue() deletes if duplicate 1`] = ` Array [ Object { "graphql": Object { @@ -1417,7 +1417,7 @@ Array [ ] `; -exports[`platform/github ensureIssue() does not create issue if ensuring only once 1`] = ` +exports[`platform/github/index ensureIssue() does not create issue if ensuring only once 1`] = ` Array [ Object { "graphql": Object { @@ -1460,7 +1460,7 @@ Array [ ] `; -exports[`platform/github ensureIssue() does not create issue if reopen flag false and issue is already open 1`] = ` +exports[`platform/github/index ensureIssue() does not create issue if reopen flag false and issue is already open 1`] = ` Array [ Object { "graphql": Object { @@ -1514,7 +1514,7 @@ Array [ ] `; -exports[`platform/github ensureIssue() skips update if unchanged 1`] = ` +exports[`platform/github/index ensureIssue() skips update if unchanged 1`] = ` Array [ Object { "graphql": Object { @@ -1568,7 +1568,7 @@ Array [ ] `; -exports[`platform/github ensureIssue() updates issue 1`] = ` +exports[`platform/github/index ensureIssue() updates issue 1`] = ` Array [ Object { "graphql": Object { @@ -1636,7 +1636,7 @@ Array [ ] `; -exports[`platform/github ensureIssueClosing() closes issue 1`] = ` +exports[`platform/github/index ensureIssueClosing() closes issue 1`] = ` Array [ Object { "graphql": Object { @@ -1693,7 +1693,7 @@ Array [ ] `; -exports[`platform/github findIssue() finds issue 1`] = ` +exports[`platform/github/index findIssue() finds issue 1`] = ` Array [ Object { "graphql": Object { @@ -1747,7 +1747,7 @@ Array [ ] `; -exports[`platform/github findIssue() returns null if no issue 1`] = ` +exports[`platform/github/index findIssue() returns null if no issue 1`] = ` Array [ Object { "graphql": Object { @@ -1790,7 +1790,7 @@ Array [ ] `; -exports[`platform/github findPr(branchName, prTitle, state) caches pr list 1`] = ` +exports[`platform/github/index findPr(branchName, prTitle, state) caches pr list 1`] = ` Array [ Object { "headers": Object { @@ -1806,7 +1806,7 @@ Array [ ] `; -exports[`platform/github findPr(branchName, prTitle, state) returns true if no title and all state 1`] = ` +exports[`platform/github/index findPr(branchName, prTitle, state) returns true if no title and all state 1`] = ` Array [ Object { "graphql": Object { @@ -1857,7 +1857,7 @@ Array [ ] `; -exports[`platform/github findPr(branchName, prTitle, state) returns true if not open 1`] = ` +exports[`platform/github/index findPr(branchName, prTitle, state) returns true if not open 1`] = ` Array [ Object { "headers": Object { @@ -1873,7 +1873,7 @@ Array [ ] `; -exports[`platform/github getBranchPr(branchName) aborts reopen if PR is too old 1`] = ` +exports[`platform/github/index getBranchPr(branchName) aborts reopen if PR is too old 1`] = ` Array [ Object { "graphql": Object { @@ -1924,7 +1924,7 @@ Array [ ] `; -exports[`platform/github getBranchPr(branchName) aborts reopening if PR reopening fails 1`] = ` +exports[`platform/github/index getBranchPr(branchName) aborts reopening if PR reopening fails 1`] = ` Array [ Object { "graphql": Object { @@ -1989,7 +1989,7 @@ Array [ ] `; -exports[`platform/github getBranchPr(branchName) aborts reopening if branch recreation fails 1`] = ` +exports[`platform/github/index getBranchPr(branchName) aborts reopening if branch recreation fails 1`] = ` Array [ Object { "graphql": Object { @@ -2068,7 +2068,7 @@ Array [ ] `; -exports[`platform/github getBranchPr(branchName) should reopen an autoclosed PR 1`] = ` +exports[`platform/github/index getBranchPr(branchName) should reopen an autoclosed PR 1`] = ` Object { "additions": 1, "base": Object { @@ -2092,7 +2092,7 @@ Object { } `; -exports[`platform/github getBranchPr(branchName) should reopen an autoclosed PR 2`] = ` +exports[`platform/github/index getBranchPr(branchName) should reopen an autoclosed PR 2`] = ` Array [ Object { "graphql": Object { @@ -2318,7 +2318,7 @@ Array [ ] `; -exports[`platform/github getBranchPr(branchName) should return null if no PR exists 1`] = ` +exports[`platform/github/index getBranchPr(branchName) should return null if no PR exists 1`] = ` Array [ Object { "graphql": Object { @@ -2369,7 +2369,7 @@ Array [ ] `; -exports[`platform/github getBranchPr(branchName) should return the PR object 1`] = ` +exports[`platform/github/index getBranchPr(branchName) should return the PR object 1`] = ` Object { "additions": 1, "base": Object { @@ -2393,7 +2393,7 @@ Object { } `; -exports[`platform/github getBranchPr(branchName) should return the PR object 2`] = ` +exports[`platform/github/index getBranchPr(branchName) should return the PR object 2`] = ` Array [ Object { "graphql": Object { @@ -2591,7 +2591,7 @@ Array [ ] `; -exports[`platform/github getBranchPr(branchName) should return the PR object in fork mode 1`] = ` +exports[`platform/github/index getBranchPr(branchName) should return the PR object in fork mode 1`] = ` Object { "additions": 1, "base": Object { @@ -2615,7 +2615,7 @@ Object { } `; -exports[`platform/github getBranchPr(branchName) should return the PR object in fork mode 2`] = ` +exports[`platform/github/index getBranchPr(branchName) should return the PR object in fork mode 2`] = ` Array [ Object { "graphql": Object { @@ -2849,7 +2849,7 @@ Array [ ] `; -exports[`platform/github getBranchStatus() defaults to pending 1`] = ` +exports[`platform/github/index getBranchStatus() defaults to pending 1`] = ` Array [ Object { "graphql": Object { @@ -2911,7 +2911,7 @@ Array [ ] `; -exports[`platform/github getBranchStatus() return failed if unsupported requiredStatusChecks 1`] = ` +exports[`platform/github/index getBranchStatus() return failed if unsupported requiredStatusChecks 1`] = ` Array [ Object { "graphql": Object { @@ -2951,7 +2951,7 @@ Array [ ] `; -exports[`platform/github getBranchStatus() returns success if requiredStatusChecks null 1`] = ` +exports[`platform/github/index getBranchStatus() returns success if requiredStatusChecks null 1`] = ` Array [ Object { "graphql": Object { @@ -2991,7 +2991,7 @@ Array [ ] `; -exports[`platform/github getBranchStatus() should fail if a check run has failed 1`] = ` +exports[`platform/github/index getBranchStatus() should fail if a check run has failed 1`] = ` Array [ Object { "graphql": Object { @@ -3053,7 +3053,7 @@ Array [ ] `; -exports[`platform/github getBranchStatus() should fail if a check run is pending 1`] = ` +exports[`platform/github/index getBranchStatus() should fail if a check run is pending 1`] = ` Array [ Object { "graphql": Object { @@ -3115,7 +3115,7 @@ Array [ ] `; -exports[`platform/github getBranchStatus() should pass through failed 1`] = ` +exports[`platform/github/index getBranchStatus() should pass through failed 1`] = ` Array [ Object { "graphql": Object { @@ -3177,7 +3177,7 @@ Array [ ] `; -exports[`platform/github getBranchStatus() should pass through success 1`] = ` +exports[`platform/github/index getBranchStatus() should pass through success 1`] = ` Array [ Object { "graphql": Object { @@ -3239,7 +3239,7 @@ Array [ ] `; -exports[`platform/github getBranchStatus() should succeed if no status and all passed check runs 1`] = ` +exports[`platform/github/index getBranchStatus() should succeed if no status and all passed check runs 1`] = ` Array [ Object { "graphql": Object { @@ -3301,7 +3301,7 @@ Array [ ] `; -exports[`platform/github getBranchStatusCheck returns null 1`] = ` +exports[`platform/github/index getBranchStatusCheck returns null 1`] = ` Array [ Object { "graphql": Object { @@ -3352,7 +3352,7 @@ Array [ ] `; -exports[`platform/github getBranchStatusCheck returns state if found 1`] = ` +exports[`platform/github/index getBranchStatusCheck returns state if found 1`] = ` Array [ Object { "graphql": Object { @@ -3403,7 +3403,7 @@ Array [ ] `; -exports[`platform/github getJsonFile() returns file content 1`] = ` +exports[`platform/github/index getJsonFile() returns file content 1`] = ` Array [ Object { "graphql": Object { @@ -3454,7 +3454,7 @@ Array [ ] `; -exports[`platform/github getJsonFile() throws on errors 1`] = ` +exports[`platform/github/index getJsonFile() throws on errors 1`] = ` Array [ Object { "graphql": Object { @@ -3505,7 +3505,7 @@ Array [ ] `; -exports[`platform/github getJsonFile() throws on malformed JSON 1`] = ` +exports[`platform/github/index getJsonFile() throws on malformed JSON 1`] = ` Array [ Object { "graphql": Object { @@ -3556,7 +3556,7 @@ Array [ ] `; -exports[`platform/github getPr(prNo) should return PR from closed graphql result 1`] = ` +exports[`platform/github/index getPr(prNo) should return PR from closed graphql result 1`] = ` Object { "body": "dummy body", "comments": Array [ @@ -3579,7 +3579,7 @@ Your **[semantic-release](https://github.com/semantic-release/semantic-release)* } `; -exports[`platform/github getPr(prNo) should return PR from closed graphql result 2`] = ` +exports[`platform/github/index getPr(prNo) should return PR from closed graphql result 2`] = ` Array [ Object { "graphql": Object { @@ -3755,7 +3755,7 @@ Array [ ] `; -exports[`platform/github getPr(prNo) should return PR from graphql result 1`] = ` +exports[`platform/github/index getPr(prNo) should return PR from graphql result 1`] = ` Object { "canMerge": false, "canMergeReason": "mergeStateStatus = DIRTY", @@ -3771,7 +3771,7 @@ Object { } `; -exports[`platform/github getPr(prNo) should return PR from graphql result 2`] = ` +exports[`platform/github/index getPr(prNo) should return PR from graphql result 2`] = ` Array [ Object { "graphql": Object { @@ -3900,7 +3900,7 @@ Array [ ] `; -exports[`platform/github getPr(prNo) should return a PR object - 0 1`] = ` +exports[`platform/github/index getPr(prNo) should return a PR object - 0 1`] = ` Object { "base": Object { "sha": "1234", @@ -3913,7 +3913,7 @@ Object { } `; -exports[`platform/github getPr(prNo) should return a PR object - 0 2`] = ` +exports[`platform/github/index getPr(prNo) should return a PR object - 0 2`] = ` Array [ Object { "graphql": Object { @@ -4100,7 +4100,7 @@ Array [ ] `; -exports[`platform/github getPr(prNo) should return a PR object - 1 1`] = ` +exports[`platform/github/index getPr(prNo) should return a PR object - 1 1`] = ` Object { "base": Object { "sha": "1234", @@ -4118,7 +4118,7 @@ Object { } `; -exports[`platform/github getPr(prNo) should return a PR object - 1 2`] = ` +exports[`platform/github/index getPr(prNo) should return a PR object - 1 2`] = ` Array [ Object { "graphql": Object { @@ -4305,7 +4305,7 @@ Array [ ] `; -exports[`platform/github getPr(prNo) should return a PR object - 2 1`] = ` +exports[`platform/github/index getPr(prNo) should return a PR object - 2 1`] = ` Object { "base": Object { "sha": "5678", @@ -4321,7 +4321,7 @@ Object { } `; -exports[`platform/github getPr(prNo) should return a PR object - 2 2`] = ` +exports[`platform/github/index getPr(prNo) should return a PR object - 2 2`] = ` Array [ Object { "graphql": Object { @@ -4508,7 +4508,7 @@ Array [ ] `; -exports[`platform/github getPr(prNo) should return null if no PR is returned from GitHub 1`] = ` +exports[`platform/github/index getPr(prNo) should return null if no PR is returned from GitHub 1`] = ` Array [ Object { "graphql": Object { @@ -4695,7 +4695,7 @@ Array [ ] `; -exports[`platform/github getRepoForceRebase should detect repoForceRebase 1`] = ` +exports[`platform/github/index getRepoForceRebase should detect repoForceRebase 1`] = ` Array [ Object { "headers": Object { @@ -4711,7 +4711,7 @@ Array [ ] `; -exports[`platform/github getRepoForceRebase should handle 403 1`] = ` +exports[`platform/github/index getRepoForceRebase should handle 403 1`] = ` Array [ Object { "headers": Object { @@ -4727,7 +4727,7 @@ Array [ ] `; -exports[`platform/github getRepoForceRebase should handle 404 1`] = ` +exports[`platform/github/index getRepoForceRebase should handle 404 1`] = ` Array [ Object { "headers": Object { @@ -4743,9 +4743,9 @@ Array [ ] `; -exports[`platform/github getRepoForceRebase should throw 401 1`] = `"Response code 401 (Unauthorized)"`; +exports[`platform/github/index getRepoForceRebase should throw 401 1`] = `"Response code 401 (Unauthorized)"`; -exports[`platform/github getRepoForceRebase should throw 401 2`] = ` +exports[`platform/github/index getRepoForceRebase should throw 401 2`] = ` Array [ Object { "headers": Object { @@ -4761,14 +4761,14 @@ Array [ ] `; -exports[`platform/github getRepos should return an array of repos 1`] = ` +exports[`platform/github/index getRepos should return an array of repos 1`] = ` Array [ "a/b", "c/d", ] `; -exports[`platform/github getRepos should return an array of repos 2`] = ` +exports[`platform/github/index getRepos should return an array of repos 2`] = ` Array [ Object { "headers": Object { @@ -4784,7 +4784,7 @@ Array [ ] `; -exports[`platform/github getVulnerabilityAlerts() handles network error 1`] = ` +exports[`platform/github/index getVulnerabilityAlerts() handles network error 1`] = ` Array [ Object { "graphql": Object { @@ -4846,7 +4846,7 @@ Array [ ] `; -exports[`platform/github getVulnerabilityAlerts() returns array if found 1`] = ` +exports[`platform/github/index getVulnerabilityAlerts() returns array if found 1`] = ` Array [ Object { "graphql": Object { @@ -4908,7 +4908,7 @@ Array [ ] `; -exports[`platform/github getVulnerabilityAlerts() returns empty if disabled 1`] = ` +exports[`platform/github/index getVulnerabilityAlerts() returns empty if disabled 1`] = ` Array [ Object { "graphql": Object { @@ -4970,7 +4970,7 @@ Array [ ] `; -exports[`platform/github getVulnerabilityAlerts() returns empty if error 1`] = ` +exports[`platform/github/index getVulnerabilityAlerts() returns empty if error 1`] = ` Array [ Object { "graphql": Object { @@ -5032,7 +5032,7 @@ Array [ ] `; -exports[`platform/github initPlatform() should support custom endpoint 1`] = ` +exports[`platform/github/index initPlatform() should support custom endpoint 1`] = ` Object { "endpoint": "https://ghe.renovatebot.com/", "gitAuthor": "undefined <user@domain.com>", @@ -5040,7 +5040,7 @@ Object { } `; -exports[`platform/github initPlatform() should support custom endpoint 2`] = ` +exports[`platform/github/index initPlatform() should support custom endpoint 2`] = ` Array [ Object { "headers": Object { @@ -5067,7 +5067,7 @@ Array [ ] `; -exports[`platform/github initPlatform() should support default endpoint no email access 1`] = ` +exports[`platform/github/index initPlatform() should support default endpoint no email access 1`] = ` Object { "endpoint": "https://api.github.com/", "gitAuthor": undefined, @@ -5075,7 +5075,7 @@ Object { } `; -exports[`platform/github initPlatform() should support default endpoint no email access 2`] = ` +exports[`platform/github/index initPlatform() should support default endpoint no email access 2`] = ` Array [ Object { "headers": Object { @@ -5102,7 +5102,7 @@ Array [ ] `; -exports[`platform/github initPlatform() should support default endpoint no email result 1`] = ` +exports[`platform/github/index initPlatform() should support default endpoint no email result 1`] = ` Object { "endpoint": "https://api.github.com/", "gitAuthor": undefined, @@ -5110,7 +5110,7 @@ Object { } `; -exports[`platform/github initPlatform() should support default endpoint no email result 2`] = ` +exports[`platform/github/index initPlatform() should support default endpoint no email result 2`] = ` Array [ Object { "headers": Object { @@ -5137,7 +5137,7 @@ Array [ ] `; -exports[`platform/github initPlatform() should support default endpoint with email 1`] = ` +exports[`platform/github/index initPlatform() should support default endpoint with email 1`] = ` Object { "endpoint": "https://api.github.com/", "gitAuthor": "undefined <user@domain.com>", @@ -5145,7 +5145,7 @@ Object { } `; -exports[`platform/github initPlatform() should support default endpoint with email 2`] = ` +exports[`platform/github/index initPlatform() should support default endpoint with email 2`] = ` Array [ Object { "headers": Object { @@ -5172,7 +5172,7 @@ Array [ ] `; -exports[`platform/github initPlatform() should support gitAuthor and username 1`] = ` +exports[`platform/github/index initPlatform() should support gitAuthor and username 1`] = ` Object { "endpoint": "https://api.github.com/", "gitAuthor": "renovate@whitesourcesoftware.com", @@ -5180,7 +5180,7 @@ Object { } `; -exports[`platform/github initPlatform() should throw if user failure 1`] = ` +exports[`platform/github/index initPlatform() should throw if user failure 1`] = ` Array [ Object { "headers": Object { @@ -5196,14 +5196,14 @@ Array [ ] `; -exports[`platform/github initRepo detects fork default branch mismatch 1`] = ` +exports[`platform/github/index initRepo detects fork default branch mismatch 1`] = ` Object { "defaultBranch": "master", "isFork": false, } `; -exports[`platform/github initRepo detects fork default branch mismatch 2`] = ` +exports[`platform/github/index initRepo detects fork default branch mismatch 2`] = ` Array [ Object { "graphql": Object { @@ -5307,14 +5307,14 @@ Array [ ] `; -exports[`platform/github initRepo should fork when forkMode 1`] = ` +exports[`platform/github/index initRepo should fork when forkMode 1`] = ` Object { "defaultBranch": "master", "isFork": false, } `; -exports[`platform/github initRepo should fork when forkMode 2`] = ` +exports[`platform/github/index initRepo should fork when forkMode 2`] = ` Array [ Object { "graphql": Object { @@ -5376,14 +5376,14 @@ Array [ ] `; -exports[`platform/github initRepo should merge 1`] = ` +exports[`platform/github/index initRepo should merge 1`] = ` Object { "defaultBranch": "master", "isFork": false, } `; -exports[`platform/github initRepo should merge 2`] = ` +exports[`platform/github/index initRepo should merge 2`] = ` Array [ Object { "graphql": Object { @@ -5423,14 +5423,14 @@ Array [ ] `; -exports[`platform/github initRepo should not guess at merge 1`] = ` +exports[`platform/github/index initRepo should not guess at merge 1`] = ` Object { "defaultBranch": "master", "isFork": false, } `; -exports[`platform/github initRepo should not guess at merge 2`] = ` +exports[`platform/github/index initRepo should not guess at merge 2`] = ` Array [ Object { "graphql": Object { @@ -5470,14 +5470,14 @@ Array [ ] `; -exports[`platform/github initRepo should rebase 1`] = ` +exports[`platform/github/index initRepo should rebase 1`] = ` Object { "defaultBranch": "master", "isFork": false, } `; -exports[`platform/github initRepo should rebase 2`] = ` +exports[`platform/github/index initRepo should rebase 2`] = ` Array [ Object { "graphql": Object { @@ -5517,14 +5517,14 @@ Array [ ] `; -exports[`platform/github initRepo should squash 1`] = ` +exports[`platform/github/index initRepo should squash 1`] = ` Object { "defaultBranch": "master", "isFork": false, } `; -exports[`platform/github initRepo should squash 2`] = ` +exports[`platform/github/index initRepo should squash 2`] = ` Array [ Object { "graphql": Object { @@ -5564,7 +5564,7 @@ Array [ ] `; -exports[`platform/github initRepo should throw error if archived 1`] = ` +exports[`platform/github/index initRepo should throw error if archived 1`] = ` Array [ Object { "graphql": Object { @@ -5604,7 +5604,7 @@ Array [ ] `; -exports[`platform/github initRepo should throw error if renamed 1`] = ` +exports[`platform/github/index initRepo should throw error if renamed 1`] = ` Array [ Object { "graphql": Object { @@ -5644,14 +5644,14 @@ Array [ ] `; -exports[`platform/github initRepo should update fork when forkMode 1`] = ` +exports[`platform/github/index initRepo should update fork when forkMode 1`] = ` Object { "defaultBranch": "master", "isFork": false, } `; -exports[`platform/github initRepo should update fork when forkMode 2`] = ` +exports[`platform/github/index initRepo should update fork when forkMode 2`] = ` Array [ Object { "graphql": Object { @@ -5727,7 +5727,7 @@ Array [ ] `; -exports[`platform/github initRepo throws not-found 1`] = ` +exports[`platform/github/index initRepo throws not-found 1`] = ` Array [ Object { "graphql": Object { @@ -5767,7 +5767,7 @@ Array [ ] `; -exports[`platform/github massageMarkdown(input) returns not-updated pr body for GHE 1`] = ` +exports[`platform/github/index massageMarkdown(input) returns not-updated pr body for GHE 1`] = ` Array [ Object { "headers": Object { @@ -5829,9 +5829,9 @@ Array [ ] `; -exports[`platform/github massageMarkdown(input) returns updated pr body 1`] = `"https://github.com/foo/bar/issues/5 plus also [a link](https://togithub.com/foo/bar/issues/5)"`; +exports[`platform/github/index massageMarkdown(input) returns updated pr body 1`] = `"https://github.com/foo/bar/issues/5 plus also [a link](https://togithub.com/foo/bar/issues/5)"`; -exports[`platform/github mergePr(prNo) - autodetection should give up 1`] = ` +exports[`platform/github/index mergePr(prNo) - autodetection should give up 1`] = ` Array [ Object { "graphql": Object { @@ -5927,7 +5927,7 @@ Array [ ] `; -exports[`platform/github mergePr(prNo) - autodetection should try merge after squash 1`] = ` +exports[`platform/github/index mergePr(prNo) - autodetection should try merge after squash 1`] = ` Array [ Object { "graphql": Object { @@ -6009,7 +6009,7 @@ Array [ ] `; -exports[`platform/github mergePr(prNo) - autodetection should try rebase first 1`] = ` +exports[`platform/github/index mergePr(prNo) - autodetection should try rebase first 1`] = ` Array [ Object { "graphql": Object { @@ -6063,7 +6063,7 @@ Array [ ] `; -exports[`platform/github mergePr(prNo) - autodetection should try squash after rebase 1`] = ` +exports[`platform/github/index mergePr(prNo) - autodetection should try squash after rebase 1`] = ` Array [ Object { "graphql": Object { @@ -6117,7 +6117,7 @@ Array [ ] `; -exports[`platform/github mergePr(prNo) should handle merge error 1`] = ` +exports[`platform/github/index mergePr(prNo) should handle merge error 1`] = ` Array [ Object { "graphql": Object { @@ -6171,7 +6171,7 @@ Array [ ] `; -exports[`platform/github mergePr(prNo) should merge the PR 1`] = ` +exports[`platform/github/index mergePr(prNo) should merge the PR 1`] = ` Array [ Object { "graphql": Object { @@ -6225,7 +6225,7 @@ Array [ ] `; -exports[`platform/github setBranchStatus returns if already set 1`] = ` +exports[`platform/github/index setBranchStatus returns if already set 1`] = ` Array [ Object { "graphql": Object { @@ -6276,7 +6276,7 @@ Array [ ] `; -exports[`platform/github setBranchStatus sets branch status 1`] = ` +exports[`platform/github/index setBranchStatus sets branch status 1`] = ` Array [ Object { "graphql": Object { @@ -6363,7 +6363,7 @@ Array [ ] `; -exports[`platform/github updatePr(prNo, title, body) should update and close the PR 1`] = ` +exports[`platform/github/index updatePr(prNo, title, body) should update and close the PR 1`] = ` Array [ Object { "graphql": Object { @@ -6417,7 +6417,7 @@ Array [ ] `; -exports[`platform/github updatePr(prNo, title, body) should update the PR 1`] = ` +exports[`platform/github/index updatePr(prNo, title, body) should update the PR 1`] = ` Array [ Object { "graphql": Object { diff --git a/lib/platform/github/index.spec.ts b/lib/platform/github/index.spec.ts index 1b4d87c64b..ebcd4a20d0 100644 --- a/lib/platform/github/index.spec.ts +++ b/lib/platform/github/index.spec.ts @@ -1,7 +1,7 @@ import fs from 'fs-extra'; import { DateTime } from 'luxon'; import * as httpMock from '../../../test/http-mock'; -import { mocked } from '../../../test/util'; +import { getName, mocked } from '../../../test/util'; import { REPOSITORY_NOT_FOUND, REPOSITORY_RENAMED, @@ -12,7 +12,7 @@ import type { Platform } from '../types'; const githubApiHost = 'https://api.github.com'; -describe('platform/github', () => { +describe(getName(__filename), () => { let github: Platform; let hostRules: jest.Mocked<typeof import('../../util/host-rules')>; let git: jest.Mocked<typeof _git>; diff --git a/lib/platform/gitlab/__snapshots__/index.spec.ts.snap b/lib/platform/gitlab/__snapshots__/index.spec.ts.snap index 732b9c57b0..2650d4d63e 100644 --- a/lib/platform/gitlab/__snapshots__/index.spec.ts.snap +++ b/lib/platform/gitlab/__snapshots__/index.spec.ts.snap @@ -1,6 +1,6 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP -exports[`platform/gitlab addAssignees(issueNo, assignees) should add the given assignees to the issue 1`] = ` +exports[`platform/gitlab/index addAssignees(issueNo, assignees) should add the given assignees to the issue 1`] = ` Array [ Object { "headers": Object { @@ -27,7 +27,7 @@ Array [ ] `; -exports[`platform/gitlab addAssignees(issueNo, assignees) should add the given assignees to the issue if supported 1`] = ` +exports[`platform/gitlab/index addAssignees(issueNo, assignees) should add the given assignees to the issue if supported 1`] = ` Array [ Object { "headers": Object { @@ -76,7 +76,7 @@ Array [ ] `; -exports[`platform/gitlab addAssignees(issueNo, assignees) should swallow error 1`] = ` +exports[`platform/gitlab/index addAssignees(issueNo, assignees) should swallow error 1`] = ` Array [ Object { "headers": Object { @@ -92,7 +92,7 @@ Array [ ] `; -exports[`platform/gitlab addAssignees(issueNo, assignees) should warn if more than one assignee 1`] = ` +exports[`platform/gitlab/index addAssignees(issueNo, assignees) should warn if more than one assignee 1`] = ` Array [ Object { "headers": Object { @@ -141,7 +141,7 @@ Array [ ] `; -exports[`platform/gitlab createPr(branchName, title, body) auto-accepts the MR when requested 1`] = ` +exports[`platform/gitlab/index createPr(branchName, title, body) auto-accepts the MR when requested 1`] = ` Array [ Object { "headers": Object { @@ -218,7 +218,7 @@ Array [ ] `; -exports[`platform/gitlab createPr(branchName, title, body) returns the PR 1`] = ` +exports[`platform/gitlab/index createPr(branchName, title, body) returns the PR 1`] = ` Object { "displayNumber": "Merge Request #12345", "id": 1, @@ -229,7 +229,7 @@ Object { } `; -exports[`platform/gitlab createPr(branchName, title, body) returns the PR 2`] = ` +exports[`platform/gitlab/index createPr(branchName, title, body) returns the PR 2`] = ` Array [ Object { "headers": Object { @@ -270,7 +270,7 @@ Array [ ] `; -exports[`platform/gitlab createPr(branchName, title, body) supports draftPR on < 13.2 1`] = ` +exports[`platform/gitlab/index createPr(branchName, title, body) supports draftPR on < 13.2 1`] = ` Object { "displayNumber": "Merge Request #12345", "id": 1, @@ -282,7 +282,7 @@ Object { } `; -exports[`platform/gitlab createPr(branchName, title, body) supports draftPR on < 13.2 2`] = ` +exports[`platform/gitlab/index createPr(branchName, title, body) supports draftPR on < 13.2 2`] = ` Array [ Object { "headers": Object { @@ -323,7 +323,7 @@ Array [ ] `; -exports[`platform/gitlab createPr(branchName, title, body) supports draftPR on >= 13.2 1`] = ` +exports[`platform/gitlab/index createPr(branchName, title, body) supports draftPR on >= 13.2 1`] = ` Object { "displayNumber": "Merge Request #12345", "id": 1, @@ -335,7 +335,7 @@ Object { } `; -exports[`platform/gitlab createPr(branchName, title, body) supports draftPR on >= 13.2 2`] = ` +exports[`platform/gitlab/index createPr(branchName, title, body) supports draftPR on >= 13.2 2`] = ` Array [ Object { "headers": Object { @@ -376,7 +376,7 @@ Array [ ] `; -exports[`platform/gitlab createPr(branchName, title, body) uses default branch 1`] = ` +exports[`platform/gitlab/index createPr(branchName, title, body) uses default branch 1`] = ` Object { "displayNumber": "Merge Request #12345", "id": 1, @@ -387,7 +387,7 @@ Object { } `; -exports[`platform/gitlab createPr(branchName, title, body) uses default branch 2`] = ` +exports[`platform/gitlab/index createPr(branchName, title, body) uses default branch 2`] = ` Array [ Object { "headers": Object { @@ -428,7 +428,7 @@ Array [ ] `; -exports[`platform/gitlab deleteLabel(issueNo, label) should delete the label 1`] = ` +exports[`platform/gitlab/index deleteLabel(issueNo, label) should delete the label 1`] = ` Array [ Object { "headers": Object { @@ -458,7 +458,7 @@ Array [ ] `; -exports[`platform/gitlab ensureComment add comment if not found 1`] = ` +exports[`platform/gitlab/index ensureComment add comment if not found 1`] = ` Array [ Object { "headers": Object { @@ -499,7 +499,7 @@ Array [ ] `; -exports[`platform/gitlab ensureComment add updates comment if necessary 1`] = ` +exports[`platform/gitlab/index ensureComment add updates comment if necessary 1`] = ` Array [ Object { "headers": Object { @@ -540,7 +540,7 @@ Array [ ] `; -exports[`platform/gitlab ensureComment handles comment with no description 1`] = ` +exports[`platform/gitlab/index ensureComment handles comment with no description 1`] = ` Array [ Object { "headers": Object { @@ -567,7 +567,7 @@ Array [ ] `; -exports[`platform/gitlab ensureComment skips comment 1`] = ` +exports[`platform/gitlab/index ensureComment skips comment 1`] = ` Array [ Object { "headers": Object { @@ -594,7 +594,7 @@ Array [ ] `; -exports[`platform/gitlab ensureCommentRemoval deletes comment by content if found 1`] = ` +exports[`platform/gitlab/index ensureCommentRemoval deletes comment by content if found 1`] = ` Array [ Object { "headers": Object { @@ -632,7 +632,7 @@ Array [ ] `; -exports[`platform/gitlab ensureCommentRemoval deletes comment by topic if found 1`] = ` +exports[`platform/gitlab/index ensureCommentRemoval deletes comment by topic if found 1`] = ` Array [ Object { "headers": Object { @@ -670,7 +670,7 @@ Array [ ] `; -exports[`platform/gitlab ensureIssue() creates issue 1`] = ` +exports[`platform/gitlab/index ensureIssue() creates issue 1`] = ` Array [ Object { "headers": Object { @@ -700,7 +700,7 @@ Array [ ] `; -exports[`platform/gitlab ensureIssue() skips update if unchanged 1`] = ` +exports[`platform/gitlab/index ensureIssue() skips update if unchanged 1`] = ` Array [ Object { "headers": Object { @@ -727,7 +727,7 @@ Array [ ] `; -exports[`platform/gitlab ensureIssue() updates issue 1`] = ` +exports[`platform/gitlab/index ensureIssue() updates issue 1`] = ` Array [ Object { "headers": Object { @@ -768,7 +768,7 @@ Array [ ] `; -exports[`platform/gitlab ensureIssueClosing() closes issue 1`] = ` +exports[`platform/gitlab/index ensureIssueClosing() closes issue 1`] = ` Array [ Object { "headers": Object { @@ -798,7 +798,7 @@ Array [ ] `; -exports[`platform/gitlab findIssue() finds issue 1`] = ` +exports[`platform/gitlab/index findIssue() finds issue 1`] = ` Array [ Object { "headers": Object { @@ -825,7 +825,7 @@ Array [ ] `; -exports[`platform/gitlab findIssue() returns null if no issue 1`] = ` +exports[`platform/gitlab/index findIssue() returns null if no issue 1`] = ` Array [ Object { "headers": Object { @@ -841,7 +841,7 @@ Array [ ] `; -exports[`platform/gitlab findPr(branchName, prTitle, state) returns true if no title and all state 1`] = ` +exports[`platform/gitlab/index findPr(branchName, prTitle, state) returns true if no title and all state 1`] = ` Array [ Object { "headers": Object { @@ -857,7 +857,7 @@ Array [ ] `; -exports[`platform/gitlab findPr(branchName, prTitle, state) returns true if not open 1`] = ` +exports[`platform/gitlab/index findPr(branchName, prTitle, state) returns true if not open 1`] = ` Array [ Object { "headers": Object { @@ -873,7 +873,7 @@ Array [ ] `; -exports[`platform/gitlab findPr(branchName, prTitle, state) returns true if open and with title 1`] = ` +exports[`platform/gitlab/index findPr(branchName, prTitle, state) returns true if open and with title 1`] = ` Array [ Object { "headers": Object { @@ -889,7 +889,7 @@ Array [ ] `; -exports[`platform/gitlab findPr(branchName, prTitle, state) returns true with deprecated draft prefix title 1`] = ` +exports[`platform/gitlab/index findPr(branchName, prTitle, state) returns true with deprecated draft prefix title 1`] = ` Array [ Object { "headers": Object { @@ -905,7 +905,7 @@ Array [ ] `; -exports[`platform/gitlab findPr(branchName, prTitle, state) returns true with draft prefix title 1`] = ` +exports[`platform/gitlab/index findPr(branchName, prTitle, state) returns true with draft prefix title 1`] = ` Array [ Object { "headers": Object { @@ -921,7 +921,7 @@ Array [ ] `; -exports[`platform/gitlab findPr(branchName, prTitle, state) returns true with title 1`] = ` +exports[`platform/gitlab/index findPr(branchName, prTitle, state) returns true with title 1`] = ` Array [ Object { "headers": Object { @@ -937,7 +937,7 @@ Array [ ] `; -exports[`platform/gitlab getBranchPr(branchName) should return null if no PR exists 1`] = ` +exports[`platform/gitlab/index getBranchPr(branchName) should return null if no PR exists 1`] = ` Array [ Object { "headers": Object { @@ -964,7 +964,7 @@ Array [ ] `; -exports[`platform/gitlab getBranchPr(branchName) should return the PR object 1`] = ` +exports[`platform/gitlab/index getBranchPr(branchName) should return the PR object 1`] = ` Object { "body": undefined, "displayNumber": "Merge Request #91", @@ -980,7 +980,7 @@ Object { } `; -exports[`platform/gitlab getBranchPr(branchName) should return the PR object 2`] = ` +exports[`platform/gitlab/index getBranchPr(branchName) should return the PR object 2`] = ` Array [ Object { "headers": Object { @@ -1029,7 +1029,7 @@ Array [ ] `; -exports[`platform/gitlab getBranchPr(branchName) should strip deprecated draft prefix from title 1`] = ` +exports[`platform/gitlab/index getBranchPr(branchName) should strip deprecated draft prefix from title 1`] = ` Object { "body": undefined, "displayNumber": "Merge Request #91", @@ -1046,7 +1046,7 @@ Object { } `; -exports[`platform/gitlab getBranchPr(branchName) should strip deprecated draft prefix from title 2`] = ` +exports[`platform/gitlab/index getBranchPr(branchName) should strip deprecated draft prefix from title 2`] = ` Array [ Object { "headers": Object { @@ -1095,7 +1095,7 @@ Array [ ] `; -exports[`platform/gitlab getBranchPr(branchName) should strip draft prefix from title 1`] = ` +exports[`platform/gitlab/index getBranchPr(branchName) should strip draft prefix from title 1`] = ` Object { "body": undefined, "displayNumber": "Merge Request #91", @@ -1112,7 +1112,7 @@ Object { } `; -exports[`platform/gitlab getBranchPr(branchName) should strip draft prefix from title 2`] = ` +exports[`platform/gitlab/index getBranchPr(branchName) should strip draft prefix from title 2`] = ` Array [ Object { "headers": Object { @@ -1161,7 +1161,7 @@ Array [ ] `; -exports[`platform/gitlab getBranchStatus(branchName, requiredStatusChecks) maps custom statuses to yellow 1`] = ` +exports[`platform/gitlab/index getBranchStatus(branchName, requiredStatusChecks) maps custom statuses to yellow 1`] = ` Array [ Object { "headers": Object { @@ -1188,7 +1188,7 @@ Array [ ] `; -exports[`platform/gitlab getBranchStatus(branchName, requiredStatusChecks) returns failure if any mandatory jobs fails 1`] = ` +exports[`platform/gitlab/index getBranchStatus(branchName, requiredStatusChecks) returns failure if any mandatory jobs fails 1`] = ` Array [ Object { "headers": Object { @@ -1215,7 +1215,7 @@ Array [ ] `; -exports[`platform/gitlab getBranchStatus(branchName, requiredStatusChecks) returns failure if any mandatory jobs fails and one job is skipped 1`] = ` +exports[`platform/gitlab/index getBranchStatus(branchName, requiredStatusChecks) returns failure if any mandatory jobs fails and one job is skipped 1`] = ` Array [ Object { "headers": Object { @@ -1242,7 +1242,7 @@ Array [ ] `; -exports[`platform/gitlab getBranchStatus(branchName, requiredStatusChecks) returns pending if no results 1`] = ` +exports[`platform/gitlab/index getBranchStatus(branchName, requiredStatusChecks) returns pending if no results 1`] = ` Array [ Object { "headers": Object { @@ -1269,7 +1269,7 @@ Array [ ] `; -exports[`platform/gitlab getBranchStatus(branchName, requiredStatusChecks) returns success if all are optional 1`] = ` +exports[`platform/gitlab/index getBranchStatus(branchName, requiredStatusChecks) returns success if all are optional 1`] = ` Array [ Object { "headers": Object { @@ -1296,7 +1296,7 @@ Array [ ] `; -exports[`platform/gitlab getBranchStatus(branchName, requiredStatusChecks) returns success if all are success 1`] = ` +exports[`platform/gitlab/index getBranchStatus(branchName, requiredStatusChecks) returns success if all are success 1`] = ` Array [ Object { "headers": Object { @@ -1323,7 +1323,7 @@ Array [ ] `; -exports[`platform/gitlab getBranchStatus(branchName, requiredStatusChecks) returns success if job is skipped 1`] = ` +exports[`platform/gitlab/index getBranchStatus(branchName, requiredStatusChecks) returns success if job is skipped 1`] = ` Array [ Object { "headers": Object { @@ -1350,7 +1350,7 @@ Array [ ] `; -exports[`platform/gitlab getBranchStatus(branchName, requiredStatusChecks) returns success if optional jobs fail 1`] = ` +exports[`platform/gitlab/index getBranchStatus(branchName, requiredStatusChecks) returns success if optional jobs fail 1`] = ` Array [ Object { "headers": Object { @@ -1377,7 +1377,7 @@ Array [ ] `; -exports[`platform/gitlab getBranchStatus(branchName, requiredStatusChecks) returns yellow if there are no jobs expect skipped 1`] = ` +exports[`platform/gitlab/index getBranchStatus(branchName, requiredStatusChecks) returns yellow if there are no jobs expect skipped 1`] = ` Array [ Object { "headers": Object { @@ -1404,7 +1404,7 @@ Array [ ] `; -exports[`platform/gitlab getBranchStatus(branchName, requiredStatusChecks) throws repository-changed 1`] = ` +exports[`platform/gitlab/index getBranchStatus(branchName, requiredStatusChecks) throws repository-changed 1`] = ` Array [ Object { "headers": Object { @@ -1420,7 +1420,7 @@ Array [ ] `; -exports[`platform/gitlab getBranchStatusCheck returns null if no matching results 1`] = ` +exports[`platform/gitlab/index getBranchStatusCheck returns null if no matching results 1`] = ` Array [ Object { "headers": Object { @@ -1447,7 +1447,7 @@ Array [ ] `; -exports[`platform/gitlab getBranchStatusCheck returns null if no results 1`] = ` +exports[`platform/gitlab/index getBranchStatusCheck returns null if no results 1`] = ` Array [ Object { "headers": Object { @@ -1474,7 +1474,7 @@ Array [ ] `; -exports[`platform/gitlab getBranchStatusCheck returns status if name found 1`] = ` +exports[`platform/gitlab/index getBranchStatusCheck returns status if name found 1`] = ` Array [ Object { "headers": Object { @@ -1501,7 +1501,7 @@ Array [ ] `; -exports[`platform/gitlab getJsonFile() returns file content 1`] = ` +exports[`platform/gitlab/index getJsonFile() returns file content 1`] = ` Array [ Object { "headers": Object { @@ -1528,7 +1528,7 @@ Array [ ] `; -exports[`platform/gitlab getJsonFile() throws on errors 1`] = ` +exports[`platform/gitlab/index getJsonFile() throws on errors 1`] = ` Array [ Object { "headers": Object { @@ -1555,7 +1555,7 @@ Array [ ] `; -exports[`platform/gitlab getJsonFile() throws on malformed JSON 1`] = ` +exports[`platform/gitlab/index getJsonFile() throws on malformed JSON 1`] = ` Array [ Object { "headers": Object { @@ -1582,7 +1582,7 @@ Array [ ] `; -exports[`platform/gitlab getPr(prNo) removes deprecated draft prefix from returned title 1`] = ` +exports[`platform/gitlab/index getPr(prNo) removes deprecated draft prefix from returned title 1`] = ` Object { "body": "a merge request", "canMerge": false, @@ -1601,7 +1601,7 @@ Object { } `; -exports[`platform/gitlab getPr(prNo) removes deprecated draft prefix from returned title 2`] = ` +exports[`platform/gitlab/index getPr(prNo) removes deprecated draft prefix from returned title 2`] = ` Array [ Object { "headers": Object { @@ -1617,7 +1617,7 @@ Array [ ] `; -exports[`platform/gitlab getPr(prNo) removes draft prefix from returned title 1`] = ` +exports[`platform/gitlab/index getPr(prNo) removes draft prefix from returned title 1`] = ` Object { "body": "a merge request", "canMerge": false, @@ -1636,7 +1636,7 @@ Object { } `; -exports[`platform/gitlab getPr(prNo) removes draft prefix from returned title 2`] = ` +exports[`platform/gitlab/index getPr(prNo) removes draft prefix from returned title 2`] = ` Array [ Object { "headers": Object { @@ -1652,7 +1652,7 @@ Array [ ] `; -exports[`platform/gitlab getPr(prNo) returns the PR 1`] = ` +exports[`platform/gitlab/index getPr(prNo) returns the PR 1`] = ` Object { "body": "a merge request", "canMerge": false, @@ -1670,7 +1670,7 @@ Object { } `; -exports[`platform/gitlab getPr(prNo) returns the PR 2`] = ` +exports[`platform/gitlab/index getPr(prNo) returns the PR 2`] = ` Array [ Object { "headers": Object { @@ -1686,7 +1686,7 @@ Array [ ] `; -exports[`platform/gitlab getPr(prNo) returns the PR with nonexisting branch 1`] = ` +exports[`platform/gitlab/index getPr(prNo) returns the PR with nonexisting branch 1`] = ` Object { "body": "a merge request", "canMerge": false, @@ -1704,7 +1704,7 @@ Object { } `; -exports[`platform/gitlab getPr(prNo) returns the PR with nonexisting branch 2`] = ` +exports[`platform/gitlab/index getPr(prNo) returns the PR with nonexisting branch 2`] = ` Array [ Object { "headers": Object { @@ -1720,7 +1720,7 @@ Array [ ] `; -exports[`platform/gitlab getPr(prNo) returns the mergeable PR 1`] = ` +exports[`platform/gitlab/index getPr(prNo) returns the mergeable PR 1`] = ` Object { "body": "a merge request", "canMerge": true, @@ -1737,7 +1737,7 @@ Object { } `; -exports[`platform/gitlab getPr(prNo) returns the mergeable PR 2`] = ` +exports[`platform/gitlab/index getPr(prNo) returns the mergeable PR 2`] = ` Array [ Object { "headers": Object { @@ -1775,7 +1775,7 @@ Array [ ] `; -exports[`platform/gitlab getRepoForceRebase should return false 1`] = ` +exports[`platform/gitlab/index getRepoForceRebase should return false 1`] = ` Array [ Object { "headers": Object { @@ -1791,7 +1791,7 @@ Array [ ] `; -exports[`platform/gitlab getRepoForceRebase should return true 1`] = ` +exports[`platform/gitlab/index getRepoForceRebase should return true 1`] = ` Array [ Object { "headers": Object { @@ -1807,14 +1807,14 @@ Array [ ] `; -exports[`platform/gitlab getRepos should return an array of repos 1`] = ` +exports[`platform/gitlab/index getRepos should return an array of repos 1`] = ` Array [ "a/b", "c/d", ] `; -exports[`platform/gitlab getRepos should return an array of repos 2`] = ` +exports[`platform/gitlab/index getRepos should return an array of repos 2`] = ` Array [ Object { "headers": Object { @@ -1830,7 +1830,7 @@ Array [ ] `; -exports[`platform/gitlab getRepos should throw an error if it receives an error 1`] = ` +exports[`platform/gitlab/index getRepos should throw an error if it receives an error 1`] = ` Array [ Object { "headers": Object { @@ -1846,14 +1846,14 @@ Array [ ] `; -exports[`platform/gitlab initPlatform() should accept custom endpoint 1`] = ` +exports[`platform/gitlab/index initPlatform() should accept custom endpoint 1`] = ` Object { "endpoint": "https://gitlab.renovatebot.com/", "gitAuthor": "Renovate Bot <a@b.com>", } `; -exports[`platform/gitlab initPlatform() should accept custom endpoint 2`] = ` +exports[`platform/gitlab/index initPlatform() should accept custom endpoint 2`] = ` Array [ Object { "headers": Object { @@ -1880,14 +1880,14 @@ Array [ ] `; -exports[`platform/gitlab initPlatform() should default to gitlab.com 1`] = ` +exports[`platform/gitlab/index initPlatform() should default to gitlab.com 1`] = ` Object { "endpoint": "https://gitlab.com/api/v4/", "gitAuthor": "Renovate Bot <a@b.com>", } `; -exports[`platform/gitlab initPlatform() should default to gitlab.com 2`] = ` +exports[`platform/gitlab/index initPlatform() should default to gitlab.com 2`] = ` Array [ Object { "headers": Object { @@ -1914,7 +1914,7 @@ Array [ ] `; -exports[`platform/gitlab initPlatform() should throw if auth fails 1`] = ` +exports[`platform/gitlab/index initPlatform() should throw if auth fails 1`] = ` Array [ Object { "headers": Object { @@ -1930,7 +1930,7 @@ Array [ ] `; -exports[`platform/gitlab initRepo should escape all forward slashes in project names 1`] = ` +exports[`platform/gitlab/index initRepo should escape all forward slashes in project names 1`] = ` Array [ Object { "headers": Object { @@ -1946,7 +1946,7 @@ Array [ ] `; -exports[`platform/gitlab initRepo should fall back if http_url_to_repo is empty 1`] = ` +exports[`platform/gitlab/index initRepo should fall back if http_url_to_repo is empty 1`] = ` Array [ Object { "headers": Object { @@ -1962,7 +1962,7 @@ Array [ ] `; -exports[`platform/gitlab initRepo should throw an error if MRs are disabled 1`] = ` +exports[`platform/gitlab/index initRepo should throw an error if MRs are disabled 1`] = ` Array [ Object { "headers": Object { @@ -1978,7 +1978,7 @@ Array [ ] `; -exports[`platform/gitlab initRepo should throw an error if receiving an error 1`] = ` +exports[`platform/gitlab/index initRepo should throw an error if receiving an error 1`] = ` Array [ Object { "headers": Object { @@ -1994,7 +1994,7 @@ Array [ ] `; -exports[`platform/gitlab initRepo should throw an error if repository access is disabled 1`] = ` +exports[`platform/gitlab/index initRepo should throw an error if repository access is disabled 1`] = ` Array [ Object { "headers": Object { @@ -2010,7 +2010,7 @@ Array [ ] `; -exports[`platform/gitlab initRepo should throw an error if repository has empty_repo property 1`] = ` +exports[`platform/gitlab/index initRepo should throw an error if repository has empty_repo property 1`] = ` Array [ Object { "headers": Object { @@ -2026,7 +2026,7 @@ Array [ ] `; -exports[`platform/gitlab initRepo should throw an error if repository is a mirror 1`] = ` +exports[`platform/gitlab/index initRepo should throw an error if repository is a mirror 1`] = ` Array [ Object { "headers": Object { @@ -2042,7 +2042,7 @@ Array [ ] `; -exports[`platform/gitlab initRepo should throw an error if repository is archived 1`] = ` +exports[`platform/gitlab/index initRepo should throw an error if repository is archived 1`] = ` Array [ Object { "headers": Object { @@ -2058,7 +2058,7 @@ Array [ ] `; -exports[`platform/gitlab initRepo should throw an error if repository is empty 1`] = ` +exports[`platform/gitlab/index initRepo should throw an error if repository is empty 1`] = ` Array [ Object { "headers": Object { @@ -2074,7 +2074,7 @@ Array [ ] `; -exports[`platform/gitlab massageMarkdown(input) returns updated pr body 1`] = ` +exports[`platform/gitlab/index massageMarkdown(input) returns updated pr body 1`] = ` "https://github.com/foo/bar/issues/5 plus also [a link](https://github.com/foo/bar/issues/5 Merge Requests are the best, here are some MRs. @@ -2087,7 +2087,7 @@ These updates have all been created already. Click a checkbox below to force a r " `; -exports[`platform/gitlab mergePr(pr) merges the PR 1`] = ` +exports[`platform/gitlab/index mergePr(pr) merges the PR 1`] = ` Array [ Object { "body": "{\\"should_remove_source_branch\\":true}", @@ -2106,7 +2106,7 @@ Array [ ] `; -exports[`platform/gitlab setBranchStatus sets branch status green 1`] = ` +exports[`platform/gitlab/index setBranchStatus sets branch status green 1`] = ` Array [ Object { "headers": Object { @@ -2147,7 +2147,7 @@ Array [ ] `; -exports[`platform/gitlab setBranchStatus sets branch status red 1`] = ` +exports[`platform/gitlab/index setBranchStatus sets branch status red 1`] = ` Array [ Object { "headers": Object { @@ -2188,7 +2188,7 @@ Array [ ] `; -exports[`platform/gitlab setBranchStatus sets branch status yellow 1`] = ` +exports[`platform/gitlab/index setBranchStatus sets branch status yellow 1`] = ` Array [ Object { "headers": Object { @@ -2229,7 +2229,7 @@ Array [ ] `; -exports[`platform/gitlab updatePr(prNo, title, body) closes the PR 1`] = ` +exports[`platform/gitlab/index updatePr(prNo, title, body) closes the PR 1`] = ` Array [ Object { "headers": Object { @@ -2281,7 +2281,7 @@ Array [ ] `; -exports[`platform/gitlab updatePr(prNo, title, body) retains draft status when draft uses current prefix 1`] = ` +exports[`platform/gitlab/index updatePr(prNo, title, body) retains draft status when draft uses current prefix 1`] = ` Array [ Object { "headers": Object { @@ -2333,7 +2333,7 @@ Array [ ] `; -exports[`platform/gitlab updatePr(prNo, title, body) retains draft status when draft uses deprecated prefix 1`] = ` +exports[`platform/gitlab/index updatePr(prNo, title, body) retains draft status when draft uses deprecated prefix 1`] = ` Array [ Object { "headers": Object { @@ -2385,7 +2385,7 @@ Array [ ] `; -exports[`platform/gitlab updatePr(prNo, title, body) updates the PR 1`] = ` +exports[`platform/gitlab/index updatePr(prNo, title, body) updates the PR 1`] = ` Array [ Object { "headers": Object { diff --git a/lib/platform/gitlab/index.spec.ts b/lib/platform/gitlab/index.spec.ts index d2d1182775..b60e0ac2ee 100644 --- a/lib/platform/gitlab/index.spec.ts +++ b/lib/platform/gitlab/index.spec.ts @@ -2,6 +2,7 @@ import nock from 'nock'; import { Platform, RepoParams } from '..'; import * as httpMock from '../../../test/http-mock'; +import { getName } from '../../../test/util'; import { REPOSITORY_ARCHIVED, REPOSITORY_CHANGED, @@ -16,7 +17,7 @@ import * as _hostRules from '../../util/host-rules'; const gitlabApiHost = 'https://gitlab.com'; -describe('platform/gitlab', () => { +describe(getName(__filename), () => { let gitlab: Platform; let hostRules: jest.Mocked<typeof _hostRules>; let git: jest.Mocked<typeof _git>; diff --git a/lib/platform/utils/pr-body.spec.ts b/lib/platform/utils/pr-body.spec.ts index 67558e5169..ab0b3a7cfe 100644 --- a/lib/platform/utils/pr-body.spec.ts +++ b/lib/platform/utils/pr-body.spec.ts @@ -1,7 +1,8 @@ import fs from 'fs-extra'; +import { getName } from '../../../test/util'; import { smartTruncate } from './pr-body'; -describe('platform/utils/pr-body', () => { +describe(getName(__filename), () => { let prBody: string; beforeAll(async () => { prBody = await fs.readFile( diff --git a/lib/platform/utils/read-only-issue-body.spec.ts b/lib/platform/utils/read-only-issue-body.spec.ts index 0bd87efa36..440d4b82ac 100644 --- a/lib/platform/utils/read-only-issue-body.spec.ts +++ b/lib/platform/utils/read-only-issue-body.spec.ts @@ -1,7 +1,8 @@ import fs from 'fs-extra'; +import { getName } from '../../../test/util'; import { readOnlyIssueBody } from './read-only-issue-body'; -describe('platform/utils/read-only-issue-body', () => { +describe(getName(__filename), () => { let issueBody: string; beforeAll(async () => { issueBody = await fs.readFile( diff --git a/lib/util/cache/package/file.spec.ts b/lib/util/cache/package/file.spec.ts index d4d26fcac8..7248343c02 100644 --- a/lib/util/cache/package/file.spec.ts +++ b/lib/util/cache/package/file.spec.ts @@ -1,7 +1,8 @@ import os from 'os'; +import { getName } from '../../../../test/util'; import { get, init, set } from './file'; -describe('lib/util/cache/global/file', () => { +describe(getName(__filename), () => { it('returns if uninitiated', async () => { await set('test', 'key', 1234); expect(await get('test', 'key')).toBeUndefined(); diff --git a/lib/util/cache/repository/index.spec.ts b/lib/util/cache/repository/index.spec.ts index f62a6e5e8d..9ac8eb0977 100644 --- a/lib/util/cache/repository/index.spec.ts +++ b/lib/util/cache/repository/index.spec.ts @@ -1,12 +1,12 @@ import * as _fs from 'fs-extra'; -import { mocked } from '../../../../test/util'; +import { getName, mocked } from '../../../../test/util'; import * as repositoryCache from '.'; jest.mock('fs-extra'); const fs = mocked(_fs); -describe('lib/util/cache/repository', () => { +describe(getName(__filename), () => { beforeEach(() => { jest.resetAllMocks(); }); diff --git a/lib/util/fs/proxies.spec.ts b/lib/util/fs/proxies.spec.ts index 91a97c709a..4ea97c5755 100644 --- a/lib/util/fs/proxies.spec.ts +++ b/lib/util/fs/proxies.spec.ts @@ -1,9 +1,10 @@ import * as fs from 'fs-extra'; +import { getName } from '../../../test/util'; import { remove } from './proxies'; jest.mock('fs-extra'); -describe('utils/fs/proxies', () => { +describe(getName(__filename), () => { describe('remove', () => { it('should call remove in fs-extra', async () => { (fs.remove as jest.Mock).mockResolvedValue(undefined); diff --git a/lib/util/git/__snapshots__/index.spec.ts.snap b/lib/util/git/__snapshots__/index.spec.ts.snap index 4f03a4baee..5708930906 100644 --- a/lib/util/git/__snapshots__/index.spec.ts.snap +++ b/lib/util/git/__snapshots__/index.spec.ts.snap @@ -1,19 +1,19 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP -exports[`platform/git getBranchFiles(branchName) detects changed files compared to current base branch 1`] = ` +exports[`util/git/index getBranchFiles(branchName) detects changed files compared to current base branch 1`] = ` Array [ "some-new-file", ] `; -exports[`platform/git getCommitMessages() returns commit messages 1`] = ` +exports[`util/git/index getCommitMessages() returns commit messages 1`] = ` Array [ "master message", "past message", ] `; -exports[`platform/git getFileList() should exclude submodules 1`] = ` +exports[`util/git/index getFileList() should exclude submodules 1`] = ` Array [ ".gitmodules", "file_to_delete", @@ -22,7 +22,7 @@ Array [ ] `; -exports[`platform/git getFileList() should return the correct files 1`] = ` +exports[`util/git/index getFileList() should return the correct files 1`] = ` Array [ "file_to_delete", "master_file", @@ -30,14 +30,14 @@ Array [ ] `; -exports[`platform/git initRepo()) should fetch latest 1`] = ` +exports[`util/git/index initRepo()) should fetch latest 1`] = ` Array [ "master message", "past message", ] `; -exports[`platform/git initRepo()) should fetch latest 2`] = ` +exports[`util/git/index initRepo()) should fetch latest 2`] = ` Array [ "past message2", "master message", diff --git a/lib/util/git/index.spec.ts b/lib/util/git/index.spec.ts index ec59af45b9..9e0d33354e 100644 --- a/lib/util/git/index.spec.ts +++ b/lib/util/git/index.spec.ts @@ -1,9 +1,10 @@ import fs from 'fs-extra'; import Git from 'simple-git'; import tmp from 'tmp-promise'; +import { getName } from '../../../test/util'; import * as git from '.'; -describe('platform/git', () => { +describe(getName(__filename), () => { jest.setTimeout(15000); const masterCommitDate = new Date(); diff --git a/lib/util/host-rules.spec.ts b/lib/util/host-rules.spec.ts index 03134fa572..e8172b4bc4 100644 --- a/lib/util/host-rules.spec.ts +++ b/lib/util/host-rules.spec.ts @@ -1,8 +1,9 @@ +import { getName } from '../../test/util'; import { PLATFORM_TYPE_AZURE } from '../constants/platforms'; import * as datasourceNuget from '../datasource/nuget'; import { add, clear, find, findAll, hosts } from './host-rules'; -describe('util/host-rules', () => { +describe(getName(__filename), () => { beforeEach(() => { clear(); }); diff --git a/lib/util/mask.spec.ts b/lib/util/mask.spec.ts index 7d0753ba96..3e283611d6 100644 --- a/lib/util/mask.spec.ts +++ b/lib/util/mask.spec.ts @@ -1,6 +1,7 @@ +import { getName } from '../../test/util'; import { maskToken } from './mask'; -describe('util/mask', () => { +describe(getName(__filename), () => { 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 bfc925898e..9056fde161 100644 --- a/lib/util/object.spec.ts +++ b/lib/util/object.spec.ts @@ -1,6 +1,7 @@ +import { getName } from '../../test/util'; import { hasKey } from './object'; -describe('util/object', () => { +describe(getName(__filename), () => { beforeEach(() => { jest.resetModules(); }); diff --git a/lib/util/regex.spec.ts b/lib/util/regex.spec.ts index b0dad6a8b3..09dba7c083 100644 --- a/lib/util/regex.spec.ts +++ b/lib/util/regex.spec.ts @@ -1,9 +1,10 @@ // eslint-disable-next-line import/no-extraneous-dependencies import RE2 from 're2'; +import { getName } from '../../test/util'; import { CONFIG_VALIDATION } from '../constants/error-messages'; import { regEx } from './regex'; -describe('util/regex', () => { +describe(getName(__filename), () => { beforeEach(() => { jest.resetModules(); }); diff --git a/lib/util/sanitize.spec.ts b/lib/util/sanitize.spec.ts index 341f2e285b..1796bce4aa 100644 --- a/lib/util/sanitize.spec.ts +++ b/lib/util/sanitize.spec.ts @@ -1,6 +1,7 @@ +import { getName } from '../../test/util'; import { add, clear, sanitize } from './sanitize'; -describe('util/sanitize', () => { +describe(getName(__filename), () => { beforeEach(() => { clear(); }); diff --git a/lib/util/split.spec.ts b/lib/util/split.spec.ts index f1f6260bfc..7c1a523744 100644 --- a/lib/util/split.spec.ts +++ b/lib/util/split.spec.ts @@ -1,6 +1,7 @@ +import { getName } from '../../test/util'; import { addSplit, getSplits, splitInit } from './split'; -describe('util/split', () => { +describe(getName(__filename), () => { it('adds splits and returns results', () => { splitInit(); addSplit('one'); diff --git a/lib/util/template/__snapshots__/index.spec.ts.snap b/lib/util/template/__snapshots__/index.spec.ts.snap index 45767123c6..e9fc704894 100644 --- a/lib/util/template/__snapshots__/index.spec.ts.snap +++ b/lib/util/template/__snapshots__/index.spec.ts.snap @@ -1,3 +1,3 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP -exports[`util/template filters out disallowed fields 1`] = `"github token = \\"\\""`; +exports[`util/template/index filters out disallowed fields 1`] = `"github token = \\"\\""`; diff --git a/lib/util/template/index.spec.ts b/lib/util/template/index.spec.ts index e7331e5dfc..2bd2b2101d 100644 --- a/lib/util/template/index.spec.ts +++ b/lib/util/template/index.spec.ts @@ -1,7 +1,8 @@ +import { getName } from '../../../test/util'; import { getOptions } from '../../config/definitions'; import * as template from '.'; -describe('util/template', () => { +describe(getName(__filename), () => { 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 b1a5d24980..fd4adfc56f 100644 --- a/lib/util/url.spec.ts +++ b/lib/util/url.spec.ts @@ -1,3 +1,4 @@ +import { getName } from '../../test/util'; import { parseUrl, resolveBaseUrl, @@ -5,7 +6,7 @@ import { validateUrl, } from './url'; -describe('util/url', () => { +describe(getName(__filename), () => { test.each([ ['http://foo.io', '', 'http://foo.io'], ['http://foo.io/', '', 'http://foo.io'], diff --git a/lib/workers/branch/__snapshots__/commit.spec.ts.snap b/lib/workers/branch/__snapshots__/commit.spec.ts.snap index d67db0c47a..a097ea3792 100644 --- a/lib/workers/branch/__snapshots__/commit.spec.ts.snap +++ b/lib/workers/branch/__snapshots__/commit.spec.ts.snap @@ -1,6 +1,6 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP -exports[`workers/branch/automerge commitFilesToBranch commits files 1`] = ` +exports[`workers/branch/commit commitFilesToBranch commits files 1`] = ` Array [ Array [ Object { diff --git a/lib/workers/branch/auto-replace.spec.ts b/lib/workers/branch/auto-replace.spec.ts index c7b56a3e82..0bf06f454b 100644 --- a/lib/workers/branch/auto-replace.spec.ts +++ b/lib/workers/branch/auto-replace.spec.ts @@ -1,6 +1,6 @@ import { readFileSync } from 'fs'; import { resolve } from 'upath'; -import { defaultConfig } from '../../../test/util'; +import { defaultConfig, getName } from '../../../test/util'; import { WORKER_FILE_UPDATE_FAILED } from '../../constants/error-messages'; import { extractPackageFile } from '../../manager/html'; import type { BranchUpgradeConfig } from '../types'; @@ -13,7 +13,7 @@ const sampleHtml = readFileSync( jest.mock('../../util/fs'); -describe('workers/branch/auto-replace', () => { +describe(getName(__filename), () => { 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 4b8bce684d..0d561f0080 100644 --- a/lib/workers/branch/automerge.spec.ts +++ b/lib/workers/branch/automerge.spec.ts @@ -1,4 +1,4 @@ -import { defaultConfig, git, platform } from '../../../test/util'; +import { defaultConfig, getName, git, platform } from '../../../test/util'; import { RenovateConfig } from '../../config'; import { setAdminConfig } from '../../config/admin'; import { BranchStatus } from '../../types'; @@ -6,7 +6,7 @@ import { tryBranchAutomerge } from './automerge'; jest.mock('../../util/git'); -describe('workers/branch/automerge', () => { +describe(getName(__filename), () => { 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 8149ac4f40..e92bcadf84 100644 --- a/lib/workers/branch/check-existing.spec.ts +++ b/lib/workers/branch/check-existing.spec.ts @@ -1,9 +1,9 @@ -import { defaultConfig, partial, platform } from '../../../test/util'; +import { defaultConfig, getName, partial, platform } from '../../../test/util'; import { PrState } from '../../types'; import type { BranchConfig } from '../types'; import { prAlreadyExisted } from './check-existing'; -describe('workers/branch/check-existing', () => { +describe(getName(__filename), () => { describe('prAlreadyExisted', () => { let config: BranchConfig; beforeEach(() => { diff --git a/lib/workers/branch/commit.spec.ts b/lib/workers/branch/commit.spec.ts index 78b1189184..50d81df7e2 100644 --- a/lib/workers/branch/commit.spec.ts +++ b/lib/workers/branch/commit.spec.ts @@ -1,11 +1,11 @@ -import { defaultConfig, git, partial } from '../../../test/util'; +import { defaultConfig, getName, git, partial } from '../../../test/util'; import { setAdminConfig } from '../../config/admin'; import type { BranchConfig } from '../types'; import { commitFilesToBranch } from './commit'; jest.mock('../../util/git'); -describe('workers/branch/automerge', () => { +describe(getName(__filename), () => { 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 c02094f945..5da097965c 100644 --- a/lib/workers/branch/get-updated.spec.ts +++ b/lib/workers/branch/get-updated.spec.ts @@ -1,4 +1,4 @@ -import { defaultConfig, git, mocked } from '../../../test/util'; +import { defaultConfig, getName, git, mocked } from '../../../test/util'; import * as datasourceGitRefs from '../../datasource/git-refs'; import * as _composer from '../../manager/composer'; import * as _gitSubmodules from '../../manager/git-submodules'; @@ -21,7 +21,7 @@ jest.mock('../../manager/git-submodules'); jest.mock('../../util/git'); jest.mock('./auto-replace'); -describe('workers/branch/get-updated', () => { +describe(getName(__filename), () => { describe('getUpdatedPackageFiles()', () => { let config: BranchConfig; beforeEach(() => { diff --git a/lib/workers/branch/index.spec.ts b/lib/workers/branch/index.spec.ts index 7f78d75ecc..359b54c823 100644 --- a/lib/workers/branch/index.spec.ts +++ b/lib/workers/branch/index.spec.ts @@ -1,5 +1,11 @@ import * as _fs from 'fs-extra'; -import { defaultConfig, git, mocked, platform } from '../../../test/util'; +import { + defaultConfig, + getName, + git, + mocked, + platform, +} from '../../../test/util'; import { setAdminConfig } from '../../config/admin'; import { MANAGER_LOCKFILE_ERROR, @@ -53,7 +59,7 @@ const sanitize = mocked(_sanitize); const fs = mocked(_fs); const limits = mocked(_limits); -describe('workers/branch', () => { +describe(getName(__filename), () => { describe('processBranch', () => { const updatedPackageFiles: PackageFilesResult = { updatedPackageFiles: [], diff --git a/lib/workers/branch/lock-files/__snapshots__/index.spec.ts.snap b/lib/workers/branch/lock-files/__snapshots__/index.spec.ts.snap index 09f1a6b4bd..8553abb902 100644 --- a/lib/workers/branch/lock-files/__snapshots__/index.spec.ts.snap +++ b/lib/workers/branch/lock-files/__snapshots__/index.spec.ts.snap @@ -1,13 +1,13 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP -exports[`manager/npm/post-update getAdditionalFiles returns no error and empty lockfiles if lock file maintenance exists 1`] = ` +exports[`workers/branch/lock-files/index getAdditionalFiles returns no error and empty lockfiles if lock file maintenance exists 1`] = ` Object { "artifactErrors": Array [], "updatedArtifacts": Array [], } `; -exports[`manager/npm/post-update getAdditionalFiles returns no error and empty lockfiles if updateLockFiles false 1`] = ` +exports[`workers/branch/lock-files/index getAdditionalFiles returns no error and empty lockfiles if updateLockFiles false 1`] = ` Object { "artifactErrors": Array [], "updatedArtifacts": Array [], diff --git a/lib/workers/branch/lock-files/index.spec.ts b/lib/workers/branch/lock-files/index.spec.ts index e78c05e28c..cc4bb406f6 100644 --- a/lib/workers/branch/lock-files/index.spec.ts +++ b/lib/workers/branch/lock-files/index.spec.ts @@ -1,4 +1,4 @@ -import { git, mocked } from '../../../../test/util'; +import { getName, git, mocked } from '../../../../test/util'; import { getConfig } from '../../../config/defaults'; import * as _lockFiles from '../../../manager/npm/post-update'; import * as _lerna from '../../../manager/npm/post-update/lerna'; @@ -27,7 +27,7 @@ hostRules.find = jest.fn((_) => ({ const { writeUpdatedPackageFiles, getAdditionalFiles } = lockFiles; -describe('manager/npm/post-update', () => { +describe(getName(__filename), () => { describe('writeUpdatedPackageFiles', () => { let config: PostUpdateConfig; beforeEach(() => { diff --git a/lib/workers/branch/schedule.spec.ts b/lib/workers/branch/schedule.spec.ts index ccd5f46f62..24c2b4b6d4 100644 --- a/lib/workers/branch/schedule.spec.ts +++ b/lib/workers/branch/schedule.spec.ts @@ -1,8 +1,9 @@ import mockDate from 'mockdate'; +import { getName } from '../../../test/util'; import { RenovateConfig } from '../../config'; import * as schedule from './schedule'; -describe('workers/branch/schedule', () => { +describe(getName(__filename), () => { 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 ed9f3b3191..8f1ec712b6 100644 --- a/lib/workers/branch/status-checks.spec.ts +++ b/lib/workers/branch/status-checks.spec.ts @@ -1,8 +1,8 @@ -import { defaultConfig, platform } from '../../../test/util'; +import { defaultConfig, getName, platform } from '../../../test/util'; import { BranchStatus } from '../../types'; import { StabilityConfig, setStability } from './status-checks'; -describe('workers/branch/status-checks', () => { +describe(getName(__filename), () => { describe('setStability', () => { let config: StabilityConfig; beforeEach(() => { diff --git a/lib/workers/global/autodiscover.spec.ts b/lib/workers/global/autodiscover.spec.ts index 4023c2c4d4..7779fcd41f 100644 --- a/lib/workers/global/autodiscover.spec.ts +++ b/lib/workers/global/autodiscover.spec.ts @@ -1,3 +1,4 @@ +import { getName } from '../../../test/util'; import { RenovateConfig } from '../../config'; import { PLATFORM_TYPE_GITHUB } from '../../constants/platforms'; import * as platform from '../../platform'; @@ -12,7 +13,7 @@ jest.unmock('../../platform'); const hostRules = _hostRules; const ghApi: jest.Mocked<typeof _ghApi> = _ghApi as never; -describe('lib/workers/global/autodiscover', () => { +describe(getName(__filename), () => { let config: RenovateConfig; beforeEach(async () => { jest.resetAllMocks(); diff --git a/lib/workers/global/index.spec.ts b/lib/workers/global/index.spec.ts index f48ca89c30..0ad22392d4 100644 --- a/lib/workers/global/index.spec.ts +++ b/lib/workers/global/index.spec.ts @@ -1,5 +1,5 @@ import { ERROR, WARN } from 'bunyan'; -import { logger } from '../../../test/util'; +import { getName, logger } from '../../../test/util'; import * as _configParser from '../../config'; import { PLATFORM_TYPE_GITHUB, @@ -19,7 +19,7 @@ const configParser: jest.Mocked<typeof _configParser> = _configParser as never; const platform: jest.Mocked<typeof _platform> = _platform as never; const limits = _limits; -describe('lib/workers/global', () => { +describe(getName(__filename), () => { beforeEach(() => { jest.resetAllMocks(); logger.getProblems.mockImplementationOnce(() => []); diff --git a/lib/workers/global/limits.spec.ts b/lib/workers/global/limits.spec.ts index 8714b92869..73a6b401f6 100644 --- a/lib/workers/global/limits.spec.ts +++ b/lib/workers/global/limits.spec.ts @@ -1,3 +1,4 @@ +import { getName } from '../../../test/util'; import { Limit, incLimitedValue, @@ -6,7 +7,7 @@ import { setMaxLimit, } from './limits'; -describe('lib/workers/global/limits', () => { +describe(getName(__filename), () => { beforeEach(() => { resetAllLimits(); }); diff --git a/lib/workers/pr/__snapshots__/index.spec.ts.snap b/lib/workers/pr/__snapshots__/index.spec.ts.snap index a56ca898a9..13361625d5 100644 --- a/lib/workers/pr/__snapshots__/index.spec.ts.snap +++ b/lib/workers/pr/__snapshots__/index.spec.ts.snap @@ -1,6 +1,6 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP -exports[`workers/pr ensurePr should add and deduplicate additionalReviewers on new PR 1`] = ` +exports[`workers/pr/index ensurePr should add and deduplicate additionalReviewers on new PR 1`] = ` Array [ Array [ undefined, @@ -14,7 +14,7 @@ Array [ ] `; -exports[`workers/pr ensurePr should add and deduplicate additionalReviewers to empty reviewers on new PR 1`] = ` +exports[`workers/pr/index ensurePr should add and deduplicate additionalReviewers to empty reviewers on new PR 1`] = ` Array [ Array [ undefined, @@ -28,7 +28,7 @@ Array [ ] `; -exports[`workers/pr ensurePr should add assignees and reviewers to new PR 1`] = ` +exports[`workers/pr/index ensurePr should add assignees and reviewers to new PR 1`] = ` Array [ Array [ undefined, @@ -40,7 +40,7 @@ Array [ ] `; -exports[`workers/pr ensurePr should add assignees and reviewers to new PR 2`] = ` +exports[`workers/pr/index ensurePr should add assignees and reviewers to new PR 2`] = ` Array [ Array [ undefined, @@ -52,7 +52,7 @@ Array [ ] `; -exports[`workers/pr ensurePr should add note about Pin 1`] = ` +exports[`workers/pr/index ensurePr should add note about Pin 1`] = ` Array [ Object { "draftPR": false, @@ -71,7 +71,7 @@ Array [ ] `; -exports[`workers/pr ensurePr should combine assignees from code owners and config 1`] = ` +exports[`workers/pr/index ensurePr should combine assignees from code owners and config 1`] = ` Array [ Array [ undefined, @@ -84,7 +84,7 @@ Array [ ] `; -exports[`workers/pr ensurePr should create PR if success 1`] = ` +exports[`workers/pr/index ensurePr should create PR if success 1`] = ` Array [ Object { "draftPR": false, @@ -103,7 +103,7 @@ Array [ ] `; -exports[`workers/pr ensurePr should create PR if success for gitlab deps 1`] = ` +exports[`workers/pr/index ensurePr should create PR if success for gitlab deps 1`] = ` Array [ Object { "draftPR": false, @@ -122,7 +122,7 @@ Array [ ] `; -exports[`workers/pr ensurePr should create group PR 1`] = ` +exports[`workers/pr/index ensurePr should create group PR 1`] = ` Array [ Object { "draftPR": false, @@ -141,7 +141,7 @@ Array [ ] `; -exports[`workers/pr ensurePr should create privateRepo PR if success 1`] = ` +exports[`workers/pr/index ensurePr should create privateRepo PR if success 1`] = ` Array [ Object { "draftPR": false, @@ -160,7 +160,7 @@ Array [ ] `; -exports[`workers/pr ensurePr should determine assignees from code owners 1`] = ` +exports[`workers/pr/index ensurePr should determine assignees from code owners 1`] = ` Array [ Array [ undefined, @@ -172,7 +172,7 @@ Array [ ] `; -exports[`workers/pr ensurePr should determine reviewers from code owners 1`] = ` +exports[`workers/pr/index ensurePr should determine reviewers from code owners 1`] = ` Array [ Array [ undefined, @@ -184,7 +184,7 @@ Array [ ] `; -exports[`workers/pr ensurePr should return modified existing PR 1`] = ` +exports[`workers/pr/index ensurePr should return modified existing PR 1`] = ` Object { "body": "This PR contains the following updates:\\n\\n| Package | Type | Update | Change |\\n|---|---|---|---|\\n| [dummy](https://dummy.com) ([source](https://github.com/renovateapp/dummy), [changelog](https://github.com/renovateapp/dummy/changelog.md)) | devDependencies | minor | \`1.0.0\` -> \`1.1.0\` |\\n\\n---\\n\\n### Release Notes\\n\\n<details>\\n<summary>renovateapp/dummy</summary>\\n\\n### [\`v1.1.0\`](https://github.com/renovateapp/dummy/compare/v1.0.0...v1.1.0)\\n\\n[Compare Source](https://github.com/renovateapp/dummy/compare/v1.0.0...v1.1.0)\\n\\n</details>\\n\\n---\\n\\n### Configuration\\n\\n:date: **Schedule**: \\"before 5am\\" (UTC).\\n\\n:vertical_traffic_light: **Automerge**: Enabled.\\n\\n:recycle: **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.\\n\\n:no_bell: **Ignore**: Close this PR and you won't be reminded about this update again.\\n\\n---\\n\\n - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box.\\n\\n---\\n\\nThis PR has been generated by [Renovate Bot](https://github.com/renovatebot/renovate).", "displayNumber": "Existing PR", @@ -192,7 +192,7 @@ Object { } `; -exports[`workers/pr ensurePr should return modified existing PR title 1`] = ` +exports[`workers/pr/index ensurePr should return modified existing PR title 1`] = ` Object { "body": "This PR contains the following updates:\\n\\n| Package | Type | Update | Change |\\n|---|---|---|---|\\n| [dummy](https://dummy.com) ([source](https://github.com/renovateapp/dummy), [changelog](https://github.com/renovateapp/dummy/changelog.md)) | devDependencies | minor | \`1.0.0\` -> \`1.1.0\` |\\n\\n---\\n\\n### Release Notes\\n\\n<details>\\n<summary>renovateapp/dummy</summary>\\n\\n### [\`v1.1.0\`](https://github.com/renovateapp/dummy/compare/v1.0.0...v1.1.0)\\n\\n[Compare Source](https://github.com/renovateapp/dummy/compare/v1.0.0...v1.1.0)\\n\\n</details>\\n\\n---\\n\\n### Configuration\\n\\n:date: **Schedule**: \\"before 5am\\" (UTC).\\n\\n:vertical_traffic_light: **Automerge**: Enabled.\\n\\n:recycle: **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.\\n\\n:no_bell: **Ignore**: Close this PR and you won't be reminded about this update again.\\n\\n---\\n\\n - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box.\\n\\n---\\n\\nThis PR has been generated by [Renovate Bot](https://github.com/renovatebot/renovate).", "displayNumber": "Existing PR", @@ -200,4 +200,4 @@ Object { } `; -exports[`workers/pr ensurePr should return unmodified existing PR 1`] = `Array []`; +exports[`workers/pr/index ensurePr should return unmodified existing PR 1`] = `Array []`; diff --git a/lib/workers/pr/body/controls.spec.ts b/lib/workers/pr/body/controls.spec.ts index 0f31b083b7..e9efa97bec 100644 --- a/lib/workers/pr/body/controls.spec.ts +++ b/lib/workers/pr/body/controls.spec.ts @@ -1,11 +1,11 @@ import { mock } from 'jest-mock-extended'; -import { git } from '../../../../test/util'; +import { getName, git } from '../../../../test/util'; import { BranchConfig } from '../../types'; import { getControls } from './controls'; jest.mock('../../../util/git'); -describe('workers/pr/body/controls', () => { +describe(getName(__filename), () => { describe('getControls', () => { let branchConfig: BranchConfig; beforeEach(() => { diff --git a/lib/workers/pr/code-owners.spec.ts b/lib/workers/pr/code-owners.spec.ts index 8832dfddbd..b1c7ec28d8 100644 --- a/lib/workers/pr/code-owners.spec.ts +++ b/lib/workers/pr/code-owners.spec.ts @@ -1,12 +1,12 @@ import { mock } from 'jest-mock-extended'; -import { fs, git } from '../../../test/util'; +import { fs, getName, git } from '../../../test/util'; import { Pr } from '../../platform'; import { codeOwnersForPr } from './code-owners'; jest.mock('../../util/fs'); jest.mock('../../util/git'); -describe('workers/pr/code-owners', () => { +describe(getName(__filename), () => { describe('codeOwnersForPr', () => { let pr: Pr; beforeEach(() => { diff --git a/lib/workers/pr/index.spec.ts b/lib/workers/pr/index.spec.ts index 67d2f61446..46be91afb6 100644 --- a/lib/workers/pr/index.spec.ts +++ b/lib/workers/pr/index.spec.ts @@ -1,4 +1,4 @@ -import { git, mocked, partial } from '../../../test/util'; +import { getName, git, mocked, partial } from '../../../test/util'; import { getConfig } from '../../config/defaults'; import { PLATFORM_TYPE_GITLAB } from '../../constants/platforms'; import { Pr, platform as _platform } from '../../platform'; @@ -98,7 +98,7 @@ function setupGitlabChangelogMock() { gitlabChangelogHelper.getChangeLogJSON.mockResolvedValue(resultValue); } -describe('workers/pr', () => { +describe(getName(__filename), () => { describe('checkAutoMerge(pr, config)', () => { let config: BranchConfig; let pr: Pr; diff --git a/lib/workers/repository/__snapshots__/dependency-dashboard.spec.ts.snap b/lib/workers/repository/__snapshots__/dependency-dashboard.spec.ts.snap index 81ae0077b7..03aae83ed1 100644 --- a/lib/workers/repository/__snapshots__/dependency-dashboard.spec.ts.snap +++ b/lib/workers/repository/__snapshots__/dependency-dashboard.spec.ts.snap @@ -1,6 +1,6 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP -exports[`workers/repository/master-issue ensureMasterIssue() contains logged problems 1`] = ` +exports[`workers/repository/dependency-dashboard ensureMasterIssue() contains logged problems 1`] = ` "This issue contains a list of Renovate updates and their statuses. ## Repository problems @@ -22,7 +22,7 @@ These updates await pending status checks. To force their creation now, check th " `; -exports[`workers/repository/master-issue ensureMasterIssue() open or update Dependency Dashboard when all branches are closed and dependencyDashboardAutoclose is false 1`] = ` +exports[`workers/repository/dependency-dashboard ensureMasterIssue() open or update Dependency Dashboard when all branches are closed and dependencyDashboardAutoclose is false 1`] = ` "This issue contains a list of Renovate updates and their statuses. This repository currently has no open or pending branches. @@ -32,7 +32,7 @@ And this is a footer " `; -exports[`workers/repository/master-issue ensureMasterIssue() open or update Dependency Dashboard when rules contain approvals 1`] = ` +exports[`workers/repository/dependency-dashboard ensureMasterIssue() open or update Dependency Dashboard when rules contain approvals 1`] = ` "This issue contains a list of Renovate updates and their statuses. This repository currently has no open or pending branches. diff --git a/lib/workers/repository/__snapshots__/index.spec.ts.snap b/lib/workers/repository/__snapshots__/index.spec.ts.snap index 220f09db93..b51587e46b 100644 --- a/lib/workers/repository/__snapshots__/index.spec.ts.snap +++ b/lib/workers/repository/__snapshots__/index.spec.ts.snap @@ -1,3 +1,3 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP -exports[`workers/repository renovateRepository() runs 1`] = `undefined`; +exports[`workers/repository/index renovateRepository() runs 1`] = `undefined`; diff --git a/lib/workers/repository/configured.spec.ts b/lib/workers/repository/configured.spec.ts index 521af44123..e65152d94f 100644 --- a/lib/workers/repository/configured.spec.ts +++ b/lib/workers/repository/configured.spec.ts @@ -1,4 +1,4 @@ -import { RenovateConfig, getConfig } from '../../../test/util'; +import { RenovateConfig, getConfig, getName } from '../../../test/util'; import { checkIfConfigured } from './configured'; let config: RenovateConfig; @@ -7,7 +7,7 @@ beforeEach(() => { config = getConfig(); }); -describe('workers/repository/configured', () => { +describe(getName(__filename), () => { 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 e53bd76101..caaa22e988 100644 --- a/lib/workers/repository/dependency-dashboard.spec.ts +++ b/lib/workers/repository/dependency-dashboard.spec.ts @@ -4,6 +4,7 @@ import { mock } from 'jest-mock-extended'; import { RenovateConfig, getConfig, + getName, logger, platform, } from '../../../test/util'; @@ -49,7 +50,7 @@ async function dryRun( expect(platform.findPr).toHaveBeenCalledTimes(findPrCalls); } -describe('workers/repository/master-issue', () => { +describe(getName(__filename), () => { describe('ensureMasterIssue()', () => { beforeEach(() => { setAdminConfig(); diff --git a/lib/workers/repository/error-config.spec.ts b/lib/workers/repository/error-config.spec.ts index 499dd9065c..6c5f39d1a6 100644 --- a/lib/workers/repository/error-config.spec.ts +++ b/lib/workers/repository/error-config.spec.ts @@ -1,5 +1,10 @@ import { mock } from 'jest-mock-extended'; -import { RenovateConfig, getConfig, platform } from '../../../test/util'; +import { + RenovateConfig, + getConfig, + getName, + platform, +} from '../../../test/util'; import { setAdminConfig } from '../../config/admin'; import { CONFIG_VALIDATION } from '../../constants/error-messages'; import { Pr } from '../../platform'; @@ -14,7 +19,7 @@ beforeEach(() => { config = getConfig(); }); -describe('workers/repository/error-config', () => { +describe(getName(__filename), () => { describe('raiseConfigWarningIssue()', () => { beforeEach(() => { setAdminConfig(); diff --git a/lib/workers/repository/error.spec.ts b/lib/workers/repository/error.spec.ts index 4d79735e3c..6d59622d32 100644 --- a/lib/workers/repository/error.spec.ts +++ b/lib/workers/repository/error.spec.ts @@ -1,4 +1,4 @@ -import { RenovateConfig, getConfig } from '../../../test/util'; +import { RenovateConfig, getConfig, getName } from '../../../test/util'; import { CONFIG_SECRETS_EXPOSED, CONFIG_VALIDATION, @@ -38,7 +38,7 @@ beforeEach(() => { config = getConfig(); }); -describe('workers/repository/error', () => { +describe(getName(__filename), () => { 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 f9b100a59d..982a9a61b3 100644 --- a/lib/workers/repository/extract/file-match.spec.ts +++ b/lib/workers/repository/extract/file-match.spec.ts @@ -1,9 +1,9 @@ -import { RenovateConfig } from '../../../../test/util'; +import { RenovateConfig, getName } from '../../../../test/util'; import * as fileMatch from './file-match'; jest.mock('../../../util/git'); -describe('workers/repository/extract/file-match', () => { +describe(getName(__filename), () => { 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 fdfff9e516..d4f3e54f95 100644 --- a/lib/workers/repository/extract/index.spec.ts +++ b/lib/workers/repository/extract/index.spec.ts @@ -1,4 +1,4 @@ -import { defaultConfig, git, mocked } from '../../../../test/util'; +import { defaultConfig, getName, git, mocked } from '../../../../test/util'; import { RenovateConfig } from '../../../config'; import * as _managerFiles from './manager-files'; import { extractAllDependencies } from '.'; @@ -8,7 +8,7 @@ jest.mock('../../../util/git'); const managerFiles = mocked(_managerFiles); -describe('workers/repository/extract/index', () => { +describe(getName(__filename), () => { 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 8a5e840281..8666f88921 100644 --- a/lib/workers/repository/extract/manager-files.spec.ts +++ b/lib/workers/repository/extract/manager-files.spec.ts @@ -1,4 +1,4 @@ -import { fs, getConfig, mocked } from '../../../../test/util'; +import { fs, getConfig, getName, mocked } from '../../../../test/util'; import { RenovateConfig } from '../../../config'; import * as _html from '../../../manager/html'; import * as _fileMatch from './file-match'; @@ -11,7 +11,7 @@ jest.mock('../../../util/fs'); const fileMatch = mocked(_fileMatch); const html = mocked(_html); -describe('workers/repository/extract/manager-files', () => { +describe(getName(__filename), () => { 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 f4e78e436f..e8cd000e46 100644 --- a/lib/workers/repository/finalise/prune.spec.ts +++ b/lib/workers/repository/finalise/prune.spec.ts @@ -1,6 +1,7 @@ import { RenovateConfig, getConfig, + getName, git, platform, } from '../../../../test/util'; @@ -19,7 +20,7 @@ beforeEach(() => { config.warnings = []; }); -describe('workers/repository/finalise/prune', () => { +describe(getName(__filename), () => { describe('pruneStaleBranches()', () => { beforeEach(() => { setAdminConfig(); diff --git a/lib/workers/repository/index.spec.ts b/lib/workers/repository/index.spec.ts index 0768a1b5af..0d5d50fa13 100644 --- a/lib/workers/repository/index.spec.ts +++ b/lib/workers/repository/index.spec.ts @@ -1,6 +1,6 @@ import { mock } from 'jest-mock-extended'; -import { RenovateConfig, getConfig, mocked } from '../../../test/util'; +import { RenovateConfig, getConfig, getName, mocked } from '../../../test/util'; import * as _process from './process'; import { ExtractResult } from './process/extract-update'; import { renovateRepository } from '.'; @@ -12,7 +12,7 @@ jest.mock('./process'); jest.mock('./result'); jest.mock('./error'); -describe('workers/repository', () => { +describe(getName(__filename), () => { describe('renovateRepository()', () => { let config: RenovateConfig; beforeEach(() => { diff --git a/lib/workers/repository/init/__snapshots__/index.spec.ts.snap b/lib/workers/repository/init/__snapshots__/index.spec.ts.snap index 639a7839bf..802c8eb539 100644 --- a/lib/workers/repository/init/__snapshots__/index.spec.ts.snap +++ b/lib/workers/repository/init/__snapshots__/index.spec.ts.snap @@ -1,3 +1,3 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP -exports[`workers/repository/init initRepo runs 1`] = `Object {}`; +exports[`workers/repository/init/index initRepo runs 1`] = `Object {}`; diff --git a/lib/workers/repository/init/apis.spec.ts b/lib/workers/repository/init/apis.spec.ts index b35f28d6f2..6a24a20e8c 100644 --- a/lib/workers/repository/init/apis.spec.ts +++ b/lib/workers/repository/init/apis.spec.ts @@ -1,11 +1,16 @@ -import { RenovateConfig, getConfig, platform } from '../../../../test/util'; +import { + RenovateConfig, + getConfig, + getName, + platform, +} from '../../../../test/util'; import { REPOSITORY_DISABLED, REPOSITORY_FORKED, } from '../../../constants/error-messages'; import { initApis } from './apis'; -describe('workers/repository/init/apis', () => { +describe(getName(__filename), () => { 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 720e45e28c..56fcc98e79 100644 --- a/lib/workers/repository/init/cache.spec.ts +++ b/lib/workers/repository/init/cache.spec.ts @@ -1,7 +1,7 @@ -import { RenovateConfig, getConfig } from '../../../../test/util'; +import { RenovateConfig, getConfig, getName } from '../../../../test/util'; import { initializeCaches } from './cache'; -describe('workers/repository/init/cache', () => { +describe(getName(__filename), () => { 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 a28ca94ba8..aa05fbf28a 100644 --- a/lib/workers/repository/init/config.spec.ts +++ b/lib/workers/repository/init/config.spec.ts @@ -2,6 +2,7 @@ import { RenovateConfig, fs, getConfig, + getName, git, mocked, } from '../../../../test/util'; @@ -30,7 +31,7 @@ beforeEach(() => { jest.mock('../../../config/migration'); jest.mock('../../../config/migrate-validate'); -describe('workers/repository/init/config', () => { +describe(getName(__filename), () => { 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 c4a27665f6..63a04cbcce 100644 --- a/lib/workers/repository/init/index.spec.ts +++ b/lib/workers/repository/init/index.spec.ts @@ -1,4 +1,4 @@ -import { mocked } from '../../../../test/util'; +import { getName, mocked } from '../../../../test/util'; import * as _secrets from '../../../config/secrets'; import * as _onboarding from '../onboarding/branch'; import * as _apis from './apis'; @@ -18,7 +18,7 @@ const config = mocked(_config); const onboarding = mocked(_onboarding); const secrets = mocked(_secrets); -describe('workers/repository/init', () => { +describe(getName(__filename), () => { 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 0a5b37fdd8..ab6def7cd3 100644 --- a/lib/workers/repository/init/semantic.spec.ts +++ b/lib/workers/repository/init/semantic.spec.ts @@ -1,4 +1,4 @@ -import { RenovateConfig, getConfig, git } from '../../../../test/util'; +import { RenovateConfig, getConfig, getName, git } from '../../../../test/util'; import { detectSemanticCommits } from './semantic'; jest.mock('../../../util/git'); @@ -11,7 +11,7 @@ beforeEach(() => { config.warnings = []; }); -describe('workers/repository/init/semantic', () => { +describe(getName(__filename), () => { 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 cec4f4fe19..c3e648704d 100644 --- a/lib/workers/repository/init/vulnerability.spec.ts +++ b/lib/workers/repository/init/vulnerability.spec.ts @@ -1,6 +1,7 @@ import { RenovateConfig, defaultConfig, + getName, partial, platform, } from '../../../../test/util'; @@ -14,7 +15,7 @@ beforeEach(() => { config = JSON.parse(JSON.stringify(defaultConfig)); }); -describe('workers/repository/init/vulnerability', () => { +describe(getName(__filename), () => { describe('detectVulnerabilityAlerts()', () => { it('returns if alerts are missing', async () => { delete config.vulnerabilityAlerts; diff --git a/lib/workers/repository/onboarding/branch/__snapshots__/index.spec.ts.snap b/lib/workers/repository/onboarding/branch/__snapshots__/index.spec.ts.snap index eef4ff259d..c9031a0ff8 100644 --- a/lib/workers/repository/onboarding/branch/__snapshots__/index.spec.ts.snap +++ b/lib/workers/repository/onboarding/branch/__snapshots__/index.spec.ts.snap @@ -1,6 +1,6 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP -exports[`workers/repository/onboarding/branch checkOnboardingBranch has default onboarding config 1`] = ` +exports[`workers/repository/onboarding/branch/index checkOnboardingBranch has default onboarding config 1`] = ` "{ \\"$schema\\": \\"https://docs.renovatebot.com/renovate-schema.json\\" } diff --git a/lib/workers/repository/onboarding/branch/config.spec.ts b/lib/workers/repository/onboarding/branch/config.spec.ts index 3b4aee3773..2755145829 100644 --- a/lib/workers/repository/onboarding/branch/config.spec.ts +++ b/lib/workers/repository/onboarding/branch/config.spec.ts @@ -1,4 +1,4 @@ -import { RenovateConfig, getConfig } from '../../../../../test/util'; +import { RenovateConfig, getConfig, getName } from '../../../../../test/util'; import * as presets from '../../../../config/presets/local'; import { PRESET_DEP_NOT_FOUND } from '../../../../config/presets/util'; import { getOnboardingConfig } from './config'; @@ -7,7 +7,7 @@ jest.mock('../../../../config/presets/local'); const mockedPresets = presets as jest.Mocked<typeof presets>; -describe('workers/repository/onboarding/branch', () => { +describe(getName(__filename), () => { 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 7f11597188..3ebd563534 100644 --- a/lib/workers/repository/onboarding/branch/create.spec.ts +++ b/lib/workers/repository/onboarding/branch/create.spec.ts @@ -1,4 +1,4 @@ -import { RenovateConfig, getConfig } from '../../../../../test/util'; +import { RenovateConfig, getConfig, getName } from '../../../../../test/util'; import { commitFiles } from '../../../../util/git'; import { COMMIT_MESSAGE_PREFIX_SEPARATOR } from '../../util/commit-message'; import { createOnboardingBranch } from './create'; @@ -25,7 +25,7 @@ const buildExpectedCommitFilesArgument = ( message, }); -describe('workers/repository/onboarding/branch', () => { +describe(getName(__filename), () => { 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 6d60cd6910..52e92a1948 100644 --- a/lib/workers/repository/onboarding/branch/index.spec.ts +++ b/lib/workers/repository/onboarding/branch/index.spec.ts @@ -3,6 +3,7 @@ import { RenovateConfig, fs, getConfig, + getName, git, platform, } from '../../../../../test/util'; @@ -17,7 +18,7 @@ jest.mock('../../../../workers/repository/onboarding/branch/rebase'); jest.mock('../../../../util/fs'); jest.mock('../../../../util/git'); -describe('workers/repository/onboarding/branch', () => { +describe(getName(__filename), () => { 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 4d3ea90d7d..90a802a0d2 100644 --- a/lib/workers/repository/onboarding/branch/rebase.spec.ts +++ b/lib/workers/repository/onboarding/branch/rebase.spec.ts @@ -1,9 +1,14 @@ -import { RenovateConfig, defaultConfig, git } from '../../../../../test/util'; +import { + RenovateConfig, + defaultConfig, + getName, + git, +} from '../../../../../test/util'; import { rebaseOnboardingBranch } from './rebase'; jest.mock('../../../../util/git'); -describe('workers/repository/onboarding/branch/rebase', () => { +describe(getName(__filename), () => { 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 c1eec93f11..fae3c6123b 100644 --- a/lib/workers/repository/onboarding/pr/base-branch.spec.ts +++ b/lib/workers/repository/onboarding/pr/base-branch.spec.ts @@ -1,8 +1,8 @@ -import { RenovateConfig, getConfig } from '../../../../../test/util'; +import { RenovateConfig, getConfig, getName } from '../../../../../test/util'; import { getBaseBranchDesc } from './base-branch'; -describe('workers/repository/onboarding/pr/base-branch', () => { +describe(getName(__filename), () => { 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 58562136a0..583a6de799 100644 --- a/lib/workers/repository/onboarding/pr/config-description.spec.ts +++ b/lib/workers/repository/onboarding/pr/config-description.spec.ts @@ -1,8 +1,8 @@ -import { RenovateConfig, getConfig } from '../../../../../test/util'; +import { RenovateConfig, getConfig, getName } from '../../../../../test/util'; import type { PackageFile } from '../../../../manager/types'; import { getConfigDesc } from './config-description'; -describe('workers/repository/onboarding/pr/config-description', () => { +describe(getName(__filename), () => { 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 0ef3fec403..b4bf84b3a3 100644 --- a/lib/workers/repository/onboarding/pr/errors-warnings.spec.ts +++ b/lib/workers/repository/onboarding/pr/errors-warnings.spec.ts @@ -1,8 +1,8 @@ -import { RenovateConfig, getConfig } from '../../../../../test/util'; +import { RenovateConfig, getConfig, getName } from '../../../../../test/util'; import type { PackageFile } from '../../../../manager/types'; import { getDepWarnings, getErrors, getWarnings } from './errors-warnings'; -describe('workers/repository/onboarding/pr/errors-warnings', () => { +describe(getName(__filename), () => { 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 856bb7c39d..516e86f852 100644 --- a/lib/workers/repository/onboarding/pr/index.spec.ts +++ b/lib/workers/repository/onboarding/pr/index.spec.ts @@ -1,6 +1,7 @@ import { RenovateConfig, defaultConfig, + getName, git, partial, platform, @@ -14,7 +15,7 @@ import { ensureOnboardingPr } from '.'; jest.mock('../../../../util/git'); -describe('workers/repository/onboarding/pr', () => { +describe(getName(__filename), () => { describe('ensureOnboardingPr()', () => { let config: RenovateConfig; let packageFiles: Record<string, PackageFile[]>; diff --git a/lib/workers/repository/onboarding/pr/pr-list.spec.ts b/lib/workers/repository/onboarding/pr/pr-list.spec.ts index 788597e158..742419fbce 100644 --- a/lib/workers/repository/onboarding/pr/pr-list.spec.ts +++ b/lib/workers/repository/onboarding/pr/pr-list.spec.ts @@ -1,8 +1,8 @@ -import { RenovateConfig, getConfig } from '../../../../../test/util'; +import { RenovateConfig, getConfig, getName } from '../../../../../test/util'; import type { BranchConfig } from '../../../types'; import { getPrList } from './pr-list'; -describe('workers/repository/onboarding/pr/pr-list', () => { +describe(getName(__filename), () => { 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 367163040d..d5bc7dd78b 100644 --- a/lib/workers/repository/process/deprecated.spec.ts +++ b/lib/workers/repository/process/deprecated.spec.ts @@ -1,7 +1,7 @@ -import { RenovateConfig, platform } from '../../../../test/util'; +import { RenovateConfig, getName, platform } from '../../../../test/util'; import { raiseDeprecationWarnings } from './deprecated'; -describe('workers/repository/process/deprecated', () => { +describe(getName(__filename), () => { 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 cf618de085..bf0b61b4f4 100644 --- a/lib/workers/repository/process/extract-update.spec.ts +++ b/lib/workers/repository/process/extract-update.spec.ts @@ -1,5 +1,5 @@ import hasha from 'hasha'; -import { git, mocked } from '../../../../test/util'; +import { getName, git, mocked } from '../../../../test/util'; import type { PackageFile } from '../../../manager/types'; import * as _repositoryCache from '../../../util/cache/repository'; import * as _branchify from '../updates/branchify'; @@ -21,7 +21,7 @@ branchify.branchifyUpgrades.mockResolvedValueOnce({ branchList: ['branchName'], }); -describe('workers/repository/process/extract-update', () => { +describe(getName(__filename), () => { 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 94a3842a2c..d87cb4c3c1 100644 --- a/lib/workers/repository/process/fetch.spec.ts +++ b/lib/workers/repository/process/fetch.spec.ts @@ -1,4 +1,9 @@ -import { RenovateConfig, getConfig, mocked } from '../../../../test/util'; +import { + RenovateConfig, + getConfig, + getName, + mocked, +} from '../../../../test/util'; import * as datasourceMaven from '../../../datasource/maven'; import * as datasourceNpm from '../../../datasource/npm'; import * as _npm from '../../../manager/npm'; @@ -11,7 +16,7 @@ const lookupUpdates = mocked(lookup).lookupUpdates; jest.mock('./lookup'); -describe('workers/repository/process/fetch', () => { +describe(getName(__filename), () => { 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 f7e7525109..e4fc2f7db3 100644 --- a/lib/workers/repository/process/index.spec.ts +++ b/lib/workers/repository/process/index.spec.ts @@ -1,4 +1,10 @@ -import { RenovateConfig, getConfig, git, mocked } from '../../../../test/util'; +import { + RenovateConfig, + getConfig, + getName, + git, + mocked, +} from '../../../../test/util'; import * as _extractUpdate from './extract-update'; import { extractDependencies, updateRepo } from '.'; @@ -13,7 +19,7 @@ beforeEach(() => { config = getConfig(); }); -describe('workers/repository/process/index', () => { +describe(getName(__filename), () => { 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 0cf5d1c22b..0d9b3ecc3c 100644 --- a/lib/workers/repository/process/limits.spec.ts +++ b/lib/workers/repository/process/limits.spec.ts @@ -2,6 +2,7 @@ import { DateTime } from 'luxon'; import { RenovateConfig, getConfig, + getName, git, platform, } from '../../../../test/util'; @@ -17,7 +18,7 @@ beforeEach(() => { config = getConfig(); }); -describe('workers/repository/process/limits', () => { +describe(getName(__filename), () => { describe('getPrHourlyRemaining()', () => { it('calculates hourly limit remaining', async () => { const time = DateTime.local(); diff --git a/lib/workers/repository/process/lookup/__snapshots__/index.spec.ts.snap b/lib/workers/repository/process/lookup/__snapshots__/index.spec.ts.snap index 4949a7f74b..230bd11ec6 100644 --- a/lib/workers/repository/process/lookup/__snapshots__/index.spec.ts.snap +++ b/lib/workers/repository/process/lookup/__snapshots__/index.spec.ts.snap @@ -1,6 +1,6 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP -exports[`workers/repository/process/lookup .lookupUpdates() disables major release separation (major) 1`] = ` +exports[`workers/repository/process/lookup/index .lookupUpdates() disables major release separation (major) 1`] = ` Array [ Object { "isPin": true, @@ -63,7 +63,7 @@ Array [ ] `; -exports[`workers/repository/process/lookup .lookupUpdates() disables major release separation (minor) 1`] = ` +exports[`workers/repository/process/lookup/index .lookupUpdates() disables major release separation (minor) 1`] = ` Array [ Object { "bucket": "latest", @@ -89,7 +89,7 @@ Array [ ] `; -exports[`workers/repository/process/lookup .lookupUpdates() handles PEP440 1`] = ` +exports[`workers/repository/process/lookup/index .lookupUpdates() handles PEP440 1`] = ` Array [ Object { "isPin": true, @@ -141,7 +141,7 @@ Array [ ] `; -exports[`workers/repository/process/lookup .lookupUpdates() handles digest pin 1`] = ` +exports[`workers/repository/process/lookup/index .lookupUpdates() handles digest pin 1`] = ` Object { "changelogUrl": undefined, "dependencyUrl": undefined, @@ -173,7 +173,7 @@ Object { } `; -exports[`workers/repository/process/lookup .lookupUpdates() handles digest pin for non-version 1`] = ` +exports[`workers/repository/process/lookup/index .lookupUpdates() handles digest pin for non-version 1`] = ` Object { "updates": Array [ Object { @@ -187,7 +187,7 @@ Object { } `; -exports[`workers/repository/process/lookup .lookupUpdates() handles digest pin for up to date version 1`] = ` +exports[`workers/repository/process/lookup/index .lookupUpdates() handles digest pin for up to date version 1`] = ` Object { "changelogUrl": undefined, "dependencyUrl": undefined, @@ -206,7 +206,7 @@ Object { } `; -exports[`workers/repository/process/lookup .lookupUpdates() handles digest update 1`] = ` +exports[`workers/repository/process/lookup/index .lookupUpdates() handles digest update 1`] = ` Object { "changelogUrl": undefined, "dependencyUrl": undefined, @@ -237,7 +237,7 @@ Object { } `; -exports[`workers/repository/process/lookup .lookupUpdates() handles digest update for non-version 1`] = ` +exports[`workers/repository/process/lookup/index .lookupUpdates() handles digest update for non-version 1`] = ` Object { "updates": Array [ Object { @@ -251,7 +251,7 @@ Object { } `; -exports[`workers/repository/process/lookup .lookupUpdates() handles git submodule update 1`] = ` +exports[`workers/repository/process/lookup/index .lookupUpdates() handles git submodule update 1`] = ` Object { "updates": Array [ Object { @@ -267,13 +267,13 @@ Object { } `; -exports[`workers/repository/process/lookup .lookupUpdates() handles github 404 1`] = `Array []`; +exports[`workers/repository/process/lookup/index .lookupUpdates() handles github 404 1`] = `Array []`; -exports[`workers/repository/process/lookup .lookupUpdates() handles packagist 1`] = `Array []`; +exports[`workers/repository/process/lookup/index .lookupUpdates() handles packagist 1`] = `Array []`; -exports[`workers/repository/process/lookup .lookupUpdates() handles pypi 404 1`] = `Array []`; +exports[`workers/repository/process/lookup/index .lookupUpdates() handles pypi 404 1`] = `Array []`; -exports[`workers/repository/process/lookup .lookupUpdates() handles sourceUrl packageRules with version restrictions 1`] = ` +exports[`workers/repository/process/lookup/index .lookupUpdates() handles sourceUrl packageRules with version restrictions 1`] = ` Object { "changelogUrl": undefined, "dependencyUrl": undefined, @@ -306,9 +306,9 @@ Object { } `; -exports[`workers/repository/process/lookup .lookupUpdates() handles unknown datasource 1`] = `Array []`; +exports[`workers/repository/process/lookup/index .lookupUpdates() handles unknown datasource 1`] = `Array []`; -exports[`workers/repository/process/lookup .lookupUpdates() ignores deprecated 1`] = ` +exports[`workers/repository/process/lookup/index .lookupUpdates() ignores deprecated 1`] = ` Object { "changelogUrl": undefined, "dependencyUrl": undefined, @@ -337,7 +337,7 @@ Marking the latest version of an npm package as deprecated results in the entire } `; -exports[`workers/repository/process/lookup .lookupUpdates() ignores pinning for ranges when other upgrade exists 1`] = ` +exports[`workers/repository/process/lookup/index .lookupUpdates() ignores pinning for ranges when other upgrade exists 1`] = ` Array [ Object { "isPin": true, @@ -371,7 +371,7 @@ Array [ ] `; -exports[`workers/repository/process/lookup .lookupUpdates() is deprecated 1`] = ` +exports[`workers/repository/process/lookup/index .lookupUpdates() is deprecated 1`] = ` Object { "changelogUrl": undefined, "dependencyUrl": undefined, @@ -399,7 +399,7 @@ Object { } `; -exports[`workers/repository/process/lookup .lookupUpdates() pins minor ranged versions 1`] = ` +exports[`workers/repository/process/lookup/index .lookupUpdates() pins minor ranged versions 1`] = ` Array [ Object { "isPin": true, @@ -410,15 +410,15 @@ Array [ ] `; -exports[`workers/repository/process/lookup .lookupUpdates() rejects complex range in-range updates 1`] = `Array []`; +exports[`workers/repository/process/lookup/index .lookupUpdates() rejects complex range in-range updates 1`] = `Array []`; -exports[`workers/repository/process/lookup .lookupUpdates() rejects in-range unsupported operator 1`] = `Array []`; +exports[`workers/repository/process/lookup/index .lookupUpdates() rejects in-range unsupported operator 1`] = `Array []`; -exports[`workers/repository/process/lookup .lookupUpdates() rejects non-fully specified in-range updates 1`] = `Array []`; +exports[`workers/repository/process/lookup/index .lookupUpdates() rejects non-fully specified in-range updates 1`] = `Array []`; -exports[`workers/repository/process/lookup .lookupUpdates() rejects reverse ordered less than greater than 1`] = `Array []`; +exports[`workers/repository/process/lookup/index .lookupUpdates() rejects reverse ordered less than greater than 1`] = `Array []`; -exports[`workers/repository/process/lookup .lookupUpdates() replaces major complex ranged versions if configured 1`] = ` +exports[`workers/repository/process/lookup/index .lookupUpdates() replaces major complex ranged versions if configured 1`] = ` Array [ Object { "bucket": "major", @@ -454,7 +454,7 @@ Array [ ] `; -exports[`workers/repository/process/lookup .lookupUpdates() replaces minor complex ranged versions if configured 1`] = ` +exports[`workers/repository/process/lookup/index .lookupUpdates() replaces minor complex ranged versions if configured 1`] = ` Array [ Object { "bucket": "non-major", @@ -474,7 +474,7 @@ Array [ ] `; -exports[`workers/repository/process/lookup .lookupUpdates() replaces non-range in-range updates 1`] = ` +exports[`workers/repository/process/lookup/index .lookupUpdates() replaces non-range in-range updates 1`] = ` Array [ Object { "bucket": "non-major", @@ -500,7 +500,7 @@ Array [ ] `; -exports[`workers/repository/process/lookup .lookupUpdates() returns additional update if grouping but separateMinorPatch=true 1`] = ` +exports[`workers/repository/process/lookup/index .lookupUpdates() returns additional update if grouping but separateMinorPatch=true 1`] = ` Array [ Object { "bucket": "patch", @@ -583,7 +583,7 @@ Array [ ] `; -exports[`workers/repository/process/lookup .lookupUpdates() returns both updates if automerging minor 1`] = ` +exports[`workers/repository/process/lookup/index .lookupUpdates() returns both updates if automerging minor 1`] = ` Array [ Object { "isPin": true, @@ -659,7 +659,7 @@ Array [ ] `; -exports[`workers/repository/process/lookup .lookupUpdates() returns complex object 1`] = ` +exports[`workers/repository/process/lookup/index .lookupUpdates() returns complex object 1`] = ` Object { "changelogUrl": undefined, "dependencyUrl": undefined, @@ -686,7 +686,7 @@ Object { } `; -exports[`workers/repository/process/lookup .lookupUpdates() returns minor update if automerging both patch and minor 1`] = ` +exports[`workers/repository/process/lookup/index .lookupUpdates() returns minor update if automerging both patch and minor 1`] = ` Array [ Object { "bucket": "non-major", @@ -732,7 +732,7 @@ Array [ ] `; -exports[`workers/repository/process/lookup .lookupUpdates() returns minor update if separate patches not configured 1`] = ` +exports[`workers/repository/process/lookup/index .lookupUpdates() returns minor update if separate patches not configured 1`] = ` Array [ Object { "bucket": "non-major", @@ -778,7 +778,7 @@ Array [ ] `; -exports[`workers/repository/process/lookup .lookupUpdates() returns multiple updates if grouping but separateMajorMinor=true 1`] = ` +exports[`workers/repository/process/lookup/index .lookupUpdates() returns multiple updates if grouping but separateMajorMinor=true 1`] = ` Array [ Object { "bucket": "non-major", @@ -849,7 +849,7 @@ Array [ ] `; -exports[`workers/repository/process/lookup .lookupUpdates() returns one update if grouping and separateMajorMinor=false 1`] = ` +exports[`workers/repository/process/lookup/index .lookupUpdates() returns one update if grouping and separateMajorMinor=false 1`] = ` Array [ Object { "bucket": "latest", @@ -908,7 +908,7 @@ Array [ ] `; -exports[`workers/repository/process/lookup .lookupUpdates() returns patch minor and major 1`] = ` +exports[`workers/repository/process/lookup/index .lookupUpdates() returns patch minor and major 1`] = ` Array [ Object { "bucket": "patch", @@ -979,7 +979,7 @@ Array [ ] `; -exports[`workers/repository/process/lookup .lookupUpdates() returns patch update if separateMinorPatch 1`] = ` +exports[`workers/repository/process/lookup/index .lookupUpdates() returns patch update if separateMinorPatch 1`] = ` Array [ Object { "bucket": "patch", @@ -1025,7 +1025,7 @@ Array [ ] `; -exports[`workers/repository/process/lookup .lookupUpdates() returns rollback for pinned version 1`] = ` +exports[`workers/repository/process/lookup/index .lookupUpdates() returns rollback for pinned version 1`] = ` Array [ Object { "branchName": "{{{branchPrefix}}}rollback-{{{depNameSanitized}}}-{{{newMajor}}}.x", @@ -1061,7 +1061,7 @@ Array [ ] `; -exports[`workers/repository/process/lookup .lookupUpdates() returns rollback for ranged version 1`] = ` +exports[`workers/repository/process/lookup/index .lookupUpdates() returns rollback for ranged version 1`] = ` Array [ Object { "branchName": "{{{branchPrefix}}}rollback-{{{depNameSanitized}}}-{{{newMajor}}}.x", @@ -1075,7 +1075,7 @@ Array [ ] `; -exports[`workers/repository/process/lookup .lookupUpdates() should allow unstable versions if the current version is unstable 1`] = ` +exports[`workers/repository/process/lookup/index .lookupUpdates() should allow unstable versions if the current version is unstable 1`] = ` Array [ Object { "bucket": "non-major", @@ -1101,7 +1101,7 @@ Array [ ] `; -exports[`workers/repository/process/lookup .lookupUpdates() should allow unstable versions if the ignoreUnstable=false 1`] = ` +exports[`workers/repository/process/lookup/index .lookupUpdates() should allow unstable versions if the ignoreUnstable=false 1`] = ` Array [ Object { "bucket": "non-major", @@ -1117,7 +1117,7 @@ Array [ ] `; -exports[`workers/repository/process/lookup .lookupUpdates() should downgrade from missing versions 1`] = ` +exports[`workers/repository/process/lookup/index .lookupUpdates() should downgrade from missing versions 1`] = ` Object { "branchName": "{{{branchPrefix}}}rollback-{{{depNameSanitized}}}-{{{newMajor}}}.x", "commitMessageAction": "Roll back", @@ -1129,7 +1129,7 @@ Object { } `; -exports[`workers/repository/process/lookup .lookupUpdates() should follow dist-tag even if newer version exists 1`] = ` +exports[`workers/repository/process/lookup/index .lookupUpdates() should follow dist-tag even if newer version exists 1`] = ` Array [ Object { "bucket": "non-major", @@ -1145,7 +1145,7 @@ Array [ ] `; -exports[`workers/repository/process/lookup .lookupUpdates() should ignore unstable versions from datasource 1`] = ` +exports[`workers/repository/process/lookup/index .lookupUpdates() should ignore unstable versions from datasource 1`] = ` Array [ Object { "bucket": "major", @@ -1160,7 +1160,7 @@ Array [ ] `; -exports[`workers/repository/process/lookup .lookupUpdates() should jump unstable versions if followTag 1`] = ` +exports[`workers/repository/process/lookup/index .lookupUpdates() should jump unstable versions if followTag 1`] = ` Array [ Object { "bucket": "non-major", @@ -1176,7 +1176,7 @@ Array [ ] `; -exports[`workers/repository/process/lookup .lookupUpdates() should not jump unstable versions 1`] = ` +exports[`workers/repository/process/lookup/index .lookupUpdates() should not jump unstable versions 1`] = ` Array [ Object { "bucket": "non-major", @@ -1192,7 +1192,7 @@ Array [ ] `; -exports[`workers/repository/process/lookup .lookupUpdates() should roll back to dist-tag if current version is higher 1`] = ` +exports[`workers/repository/process/lookup/index .lookupUpdates() should roll back to dist-tag if current version is higher 1`] = ` Array [ Object { "branchName": "{{{branchPrefix}}}rollback-{{{depNameSanitized}}}-{{{newMajor}}}.x", @@ -1206,7 +1206,7 @@ Array [ ] `; -exports[`workers/repository/process/lookup .lookupUpdates() should treat zero zero caret ranges as pinned 1`] = ` +exports[`workers/repository/process/lookup/index .lookupUpdates() should treat zero zero caret ranges as pinned 1`] = ` Array [ Object { "bucket": "non-major", @@ -1223,9 +1223,9 @@ Array [ ] `; -exports[`workers/repository/process/lookup .lookupUpdates() should warn if no version matches dist-tag 1`] = `Array []`; +exports[`workers/repository/process/lookup/index .lookupUpdates() should warn if no version matches dist-tag 1`] = `Array []`; -exports[`workers/repository/process/lookup .lookupUpdates() skips uncompatible versions for 8 1`] = ` +exports[`workers/repository/process/lookup/index .lookupUpdates() skips uncompatible versions for 8 1`] = ` Object { "changelogUrl": undefined, "dependencyUrl": undefined, @@ -1248,7 +1248,7 @@ Object { } `; -exports[`workers/repository/process/lookup .lookupUpdates() skips uncompatible versions for 8.1 1`] = ` +exports[`workers/repository/process/lookup/index .lookupUpdates() skips uncompatible versions for 8.1 1`] = ` Object { "changelogUrl": undefined, "dependencyUrl": undefined, @@ -1281,7 +1281,7 @@ Object { } `; -exports[`workers/repository/process/lookup .lookupUpdates() skips uncompatible versions for 8.1.0 1`] = ` +exports[`workers/repository/process/lookup/index .lookupUpdates() skips uncompatible versions for 8.1.0 1`] = ` Object { "changelogUrl": undefined, "dependencyUrl": undefined, @@ -1308,7 +1308,7 @@ Object { } `; -exports[`workers/repository/process/lookup .lookupUpdates() skips undefined values 1`] = ` +exports[`workers/repository/process/lookup/index .lookupUpdates() skips undefined values 1`] = ` Object { "skipReason": "invalid-value", "updates": Array [], @@ -1316,7 +1316,7 @@ Object { } `; -exports[`workers/repository/process/lookup .lookupUpdates() skips unsupported values 1`] = ` +exports[`workers/repository/process/lookup/index .lookupUpdates() skips unsupported values 1`] = ` Object { "skipReason": "invalid-value", "updates": Array [], @@ -1324,7 +1324,7 @@ Object { } `; -exports[`workers/repository/process/lookup .lookupUpdates() supports > latest versions if configured 1`] = ` +exports[`workers/repository/process/lookup/index .lookupUpdates() supports > latest versions if configured 1`] = ` Array [ Object { "bucket": "major", @@ -1345,7 +1345,7 @@ Array [ ] `; -exports[`workers/repository/process/lookup .lookupUpdates() supports complex major hyphen ranges 1`] = ` +exports[`workers/repository/process/lookup/index .lookupUpdates() supports complex major hyphen ranges 1`] = ` Array [ Object { "bucket": "major", @@ -1381,7 +1381,7 @@ Array [ ] `; -exports[`workers/repository/process/lookup .lookupUpdates() supports complex major ranges 1`] = ` +exports[`workers/repository/process/lookup/index .lookupUpdates() supports complex major ranges 1`] = ` Array [ Object { "bucket": "major", @@ -1417,7 +1417,7 @@ Array [ ] `; -exports[`workers/repository/process/lookup .lookupUpdates() supports complex ranges 1`] = ` +exports[`workers/repository/process/lookup/index .lookupUpdates() supports complex ranges 1`] = ` Object { "bucket": "non-major", "currentVersion": "0.8.12", @@ -1441,7 +1441,7 @@ Object { } `; -exports[`workers/repository/process/lookup .lookupUpdates() supports complex tilde ranges 1`] = ` +exports[`workers/repository/process/lookup/index .lookupUpdates() supports complex tilde ranges 1`] = ` Array [ Object { "bucket": "non-major", @@ -1461,7 +1461,7 @@ Array [ ] `; -exports[`workers/repository/process/lookup .lookupUpdates() supports in-range caret updates 1`] = ` +exports[`workers/repository/process/lookup/index .lookupUpdates() supports in-range caret updates 1`] = ` Array [ Object { "bucket": "non-major", @@ -1489,7 +1489,7 @@ Array [ ] `; -exports[`workers/repository/process/lookup .lookupUpdates() supports in-range gte updates 1`] = ` +exports[`workers/repository/process/lookup/index .lookupUpdates() supports in-range gte updates 1`] = ` Array [ Object { "bucket": "non-major", @@ -1517,7 +1517,7 @@ Array [ ] `; -exports[`workers/repository/process/lookup .lookupUpdates() supports in-range tilde patch updates 1`] = ` +exports[`workers/repository/process/lookup/index .lookupUpdates() supports in-range tilde patch updates 1`] = ` Array [ Object { "bucket": "patch", @@ -1556,7 +1556,7 @@ Array [ ] `; -exports[`workers/repository/process/lookup .lookupUpdates() supports in-range tilde updates 1`] = ` +exports[`workers/repository/process/lookup/index .lookupUpdates() supports in-range tilde updates 1`] = ` Array [ Object { "bucket": "patch", @@ -1595,7 +1595,7 @@ Array [ ] `; -exports[`workers/repository/process/lookup .lookupUpdates() supports lock file updates mixed with regular updates 1`] = ` +exports[`workers/repository/process/lookup/index .lookupUpdates() supports lock file updates mixed with regular updates 1`] = ` Array [ Object { "bucket": "patch", @@ -1684,7 +1684,7 @@ Array [ ] `; -exports[`workers/repository/process/lookup .lookupUpdates() supports majorgte updates 1`] = ` +exports[`workers/repository/process/lookup/index .lookupUpdates() supports majorgte updates 1`] = ` Array [ Object { "bucket": "latest", @@ -1720,7 +1720,7 @@ Array [ ] `; -exports[`workers/repository/process/lookup .lookupUpdates() supports minor and major upgrades for ranged versions 1`] = ` +exports[`workers/repository/process/lookup/index .lookupUpdates() supports minor and major upgrades for ranged versions 1`] = ` Array [ Object { "isPin": true, @@ -1796,7 +1796,7 @@ Array [ ] `; -exports[`workers/repository/process/lookup .lookupUpdates() supports minor and major upgrades for tilde ranges 1`] = ` +exports[`workers/repository/process/lookup/index .lookupUpdates() supports minor and major upgrades for tilde ranges 1`] = ` Array [ Object { "isPin": true, @@ -1872,7 +1872,7 @@ Array [ ] `; -exports[`workers/repository/process/lookup .lookupUpdates() upgrades .x complex minor ranges without pinning 1`] = ` +exports[`workers/repository/process/lookup/index .lookupUpdates() upgrades .x complex minor ranges without pinning 1`] = ` Array [ Object { "bucket": "non-major", @@ -1892,7 +1892,7 @@ Array [ ] `; -exports[`workers/repository/process/lookup .lookupUpdates() upgrades .x major ranges without pinning 1`] = ` +exports[`workers/repository/process/lookup/index .lookupUpdates() upgrades .x major ranges without pinning 1`] = ` Array [ Object { "bucket": "major", @@ -1920,7 +1920,7 @@ Array [ ] `; -exports[`workers/repository/process/lookup .lookupUpdates() upgrades .x minor ranges 1`] = ` +exports[`workers/repository/process/lookup/index .lookupUpdates() upgrades .x minor ranges 1`] = ` Array [ Object { "isPin": true, @@ -1946,7 +1946,7 @@ Array [ ] `; -exports[`workers/repository/process/lookup .lookupUpdates() upgrades .x minor ranges without pinning 1`] = ` +exports[`workers/repository/process/lookup/index .lookupUpdates() upgrades .x minor ranges without pinning 1`] = ` Array [ Object { "bucket": "non-major", @@ -1966,7 +1966,7 @@ Array [ ] `; -exports[`workers/repository/process/lookup .lookupUpdates() upgrades equal minor ranges 1`] = ` +exports[`workers/repository/process/lookup/index .lookupUpdates() upgrades equal minor ranges 1`] = ` Array [ Object { "bucket": "non-major", @@ -1986,7 +1986,7 @@ Array [ ] `; -exports[`workers/repository/process/lookup .lookupUpdates() upgrades less than equal major ranges 1`] = ` +exports[`workers/repository/process/lookup/index .lookupUpdates() upgrades less than equal major ranges 1`] = ` Array [ Object { "bucket": "major", @@ -2008,7 +2008,7 @@ Array [ ] `; -exports[`workers/repository/process/lookup .lookupUpdates() upgrades less than equal minor ranges 1`] = ` +exports[`workers/repository/process/lookup/index .lookupUpdates() upgrades less than equal minor ranges 1`] = ` Array [ Object { "bucket": "non-major", @@ -2028,7 +2028,7 @@ Array [ ] `; -exports[`workers/repository/process/lookup .lookupUpdates() upgrades less than equal ranges without pinning 1`] = ` +exports[`workers/repository/process/lookup/index .lookupUpdates() upgrades less than equal ranges without pinning 1`] = ` Array [ Object { "bucket": "non-major", @@ -2090,7 +2090,7 @@ Array [ ] `; -exports[`workers/repository/process/lookup .lookupUpdates() upgrades less than major ranges 1`] = ` +exports[`workers/repository/process/lookup/index .lookupUpdates() upgrades less than major ranges 1`] = ` Array [ Object { "bucket": "major", @@ -2118,7 +2118,7 @@ Array [ ] `; -exports[`workers/repository/process/lookup .lookupUpdates() upgrades less than ranges without pinning 1`] = ` +exports[`workers/repository/process/lookup/index .lookupUpdates() upgrades less than ranges without pinning 1`] = ` Array [ Object { "bucket": "non-major", @@ -2181,7 +2181,7 @@ Array [ ] `; -exports[`workers/repository/process/lookup .lookupUpdates() upgrades major greater than less than ranges without pinning 1`] = ` +exports[`workers/repository/process/lookup/index .lookupUpdates() upgrades major greater than less than ranges without pinning 1`] = ` Array [ Object { "bucket": "major", @@ -2209,7 +2209,7 @@ Array [ ] `; -exports[`workers/repository/process/lookup .lookupUpdates() upgrades major less than equal ranges 1`] = ` +exports[`workers/repository/process/lookup/index .lookupUpdates() upgrades major less than equal ranges 1`] = ` Array [ Object { "bucket": "non-major", @@ -2236,7 +2236,7 @@ Array [ ] `; -exports[`workers/repository/process/lookup .lookupUpdates() upgrades major less than ranges without pinning 1`] = ` +exports[`workers/repository/process/lookup/index .lookupUpdates() upgrades major less than ranges without pinning 1`] = ` Array [ Object { "bucket": "major", @@ -2264,7 +2264,7 @@ Array [ ] `; -exports[`workers/repository/process/lookup .lookupUpdates() upgrades minor greater than less than equals ranges without pinning 1`] = ` +exports[`workers/repository/process/lookup/index .lookupUpdates() upgrades minor greater than less than equals ranges without pinning 1`] = ` Array [ Object { "bucket": "non-major", @@ -2325,7 +2325,7 @@ Array [ ] `; -exports[`workers/repository/process/lookup .lookupUpdates() upgrades minor greater than less than ranges without pinning 1`] = ` +exports[`workers/repository/process/lookup/index .lookupUpdates() upgrades minor greater than less than ranges without pinning 1`] = ` Array [ Object { "bucket": "non-major", @@ -2387,7 +2387,7 @@ Array [ ] `; -exports[`workers/repository/process/lookup .lookupUpdates() upgrades minor ranged versions 1`] = ` +exports[`workers/repository/process/lookup/index .lookupUpdates() upgrades minor ranged versions 1`] = ` Array [ Object { "isPin": true, @@ -2419,7 +2419,7 @@ Array [ ] `; -exports[`workers/repository/process/lookup .lookupUpdates() upgrades multiple caret ranges without pinning 1`] = ` +exports[`workers/repository/process/lookup/index .lookupUpdates() upgrades multiple caret ranges without pinning 1`] = ` Array [ Object { "bucket": "non-major", @@ -2481,7 +2481,7 @@ Array [ ] `; -exports[`workers/repository/process/lookup .lookupUpdates() upgrades multiple tilde ranges without pinning 1`] = ` +exports[`workers/repository/process/lookup/index .lookupUpdates() upgrades multiple tilde ranges without pinning 1`] = ` Array [ Object { "bucket": "non-major", @@ -2543,7 +2543,7 @@ Array [ ] `; -exports[`workers/repository/process/lookup .lookupUpdates() upgrades shorthand major ranges without pinning 1`] = ` +exports[`workers/repository/process/lookup/index .lookupUpdates() upgrades shorthand major ranges without pinning 1`] = ` Array [ Object { "bucket": "major", @@ -2571,7 +2571,7 @@ Array [ ] `; -exports[`workers/repository/process/lookup .lookupUpdates() upgrades shorthand minor ranges without pinning 1`] = ` +exports[`workers/repository/process/lookup/index .lookupUpdates() upgrades shorthand minor ranges without pinning 1`] = ` Array [ Object { "bucket": "non-major", @@ -2591,7 +2591,7 @@ Array [ ] `; -exports[`workers/repository/process/lookup .lookupUpdates() upgrades tilde ranges 1`] = ` +exports[`workers/repository/process/lookup/index .lookupUpdates() upgrades tilde ranges 1`] = ` Array [ Object { "isPin": true, @@ -2617,7 +2617,7 @@ Array [ ] `; -exports[`workers/repository/process/lookup .lookupUpdates() upgrades tilde ranges without pinning 1`] = ` +exports[`workers/repository/process/lookup/index .lookupUpdates() upgrades tilde ranges without pinning 1`] = ` Array [ Object { "bucket": "non-major", @@ -2637,7 +2637,7 @@ Array [ ] `; -exports[`workers/repository/process/lookup .lookupUpdates() uses minimum version for vulnerabilityAlerts 1`] = ` +exports[`workers/repository/process/lookup/index .lookupUpdates() uses minimum version for vulnerabilityAlerts 1`] = ` Array [ Object { "bucket": "non-major", @@ -2653,7 +2653,7 @@ Array [ ] `; -exports[`workers/repository/process/lookup .lookupUpdates() uses the locked version for pinning 1`] = ` +exports[`workers/repository/process/lookup/index .lookupUpdates() uses the locked version for pinning 1`] = ` Array [ Object { "isPin": true, @@ -2686,7 +2686,7 @@ Array [ ] `; -exports[`workers/repository/process/lookup .lookupUpdates() widens .x OR ranges 1`] = ` +exports[`workers/repository/process/lookup/index .lookupUpdates() widens .x OR ranges 1`] = ` Array [ Object { "bucket": "major", @@ -2722,7 +2722,7 @@ Array [ ] `; -exports[`workers/repository/process/lookup .lookupUpdates() widens major ranged versions if configured 1`] = ` +exports[`workers/repository/process/lookup/index .lookupUpdates() widens major ranged versions if configured 1`] = ` Array [ Object { "bucket": "major", @@ -2758,7 +2758,7 @@ Array [ ] `; -exports[`workers/repository/process/lookup .lookupUpdates() widens minor ranged versions if configured 1`] = ` +exports[`workers/repository/process/lookup/index .lookupUpdates() widens minor ranged versions if configured 1`] = ` Array [ Object { "bucket": "non-major", @@ -2778,7 +2778,7 @@ Array [ ] `; -exports[`workers/repository/process/lookup .lookupUpdates() widens stanndalone major OR ranges 1`] = ` +exports[`workers/repository/process/lookup/index .lookupUpdates() widens stanndalone major OR ranges 1`] = ` Array [ Object { "bucket": "major", diff --git a/lib/workers/repository/process/lookup/index.spec.ts b/lib/workers/repository/process/lookup/index.spec.ts index fbee93dd5f..8aecd513dd 100644 --- a/lib/workers/repository/process/lookup/index.spec.ts +++ b/lib/workers/repository/process/lookup/index.spec.ts @@ -1,5 +1,5 @@ import nock from 'nock'; -import { getConfig, mocked, partial } from '../../../../../test/util'; +import { getConfig, getName, mocked, partial } from '../../../../../test/util'; import qJson from '../../../../config/npm/__fixtures__/01.json'; import helmetJson from '../../../../config/npm/__fixtures__/02.json'; import coffeelintJson from '../../../../config/npm/__fixtures__/coffeelint.json'; @@ -40,7 +40,7 @@ Object.assign(githubReleases, { defaultRegistryUrls: ['https://github.com'] }); let config: LookupUpdateConfig; -describe('workers/repository/process/lookup', () => { +describe(getName(__filename), () => { beforeEach(() => { // TODO: fix types config = partial<LookupUpdateConfig>(getConfig()); diff --git a/lib/workers/repository/process/sort.spec.ts b/lib/workers/repository/process/sort.spec.ts index a7b523847c..95612f625a 100644 --- a/lib/workers/repository/process/sort.spec.ts +++ b/lib/workers/repository/process/sort.spec.ts @@ -1,7 +1,8 @@ +import { getName } from '../../../../test/util'; import { UpdateType } from '../../../config'; import { sortBranches } from './sort'; -describe('workers/repository/process/sort', () => { +describe(getName(__filename), () => { 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 735a6d3a1c..5a2c4ee636 100644 --- a/lib/workers/repository/process/write.spec.ts +++ b/lib/workers/repository/process/write.spec.ts @@ -1,4 +1,10 @@ -import { RenovateConfig, getConfig, git, mocked } from '../../../../test/util'; +import { + RenovateConfig, + getConfig, + getName, + git, + mocked, +} from '../../../../test/util'; import * as _branchWorker from '../../branch'; import { Limit, isLimitReached } from '../../global/limits'; import { BranchConfig, ProcessBranchResult } from '../../types'; @@ -21,7 +27,7 @@ beforeEach(() => { config = getConfig(); }); -describe('workers/repository/write', () => { +describe(getName(__filename), () => { describe('writeUpdates()', () => { it('skips branches blocked by pin', async () => { const branches: BranchConfig[] = [ diff --git a/lib/workers/repository/result.spec.ts b/lib/workers/repository/result.spec.ts index 1966de1cef..e005284bad 100644 --- a/lib/workers/repository/result.spec.ts +++ b/lib/workers/repository/result.spec.ts @@ -1,4 +1,4 @@ -import { RenovateConfig, getConfig } from '../../../test/util'; +import { RenovateConfig, getConfig, getName } from '../../../test/util'; import { processResult } from './result'; let config: RenovateConfig; @@ -7,7 +7,7 @@ beforeEach(() => { config = getConfig(); }); -describe('workers/repository/result', () => { +describe(getName(__filename), () => { 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 a62796aa98..d4afe0aed9 100644 --- a/lib/workers/repository/stats.spec.ts +++ b/lib/workers/repository/stats.spec.ts @@ -1,3 +1,4 @@ +import { getName } from '../../../test/util'; import * as memCache_ from '../../util/cache/memory'; import { printRequestStats } from './stats'; @@ -5,7 +6,7 @@ jest.mock('../../util/cache/memory'); const memCache: any = memCache_ as any; -describe('workers/repository/stats', () => { +describe(getName(__filename), () => { 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 685174126d..4a495f747b 100644 --- a/lib/workers/repository/updates/branch-name.spec.ts +++ b/lib/workers/repository/updates/branch-name.spec.ts @@ -1,7 +1,8 @@ +import { getName } from '../../../../test/util'; import type { RenovateConfig } from '../../../config/types'; import { generateBranchName } from './branch-name'; -describe('workers/repository/updates/branch-name', () => { +describe(getName(__filename), () => { 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 37ec326838..d549938a9c 100644 --- a/lib/workers/repository/updates/branchify.spec.ts +++ b/lib/workers/repository/updates/branchify.spec.ts @@ -1,4 +1,4 @@ -import { RenovateConfig, mocked } from '../../../../test/util'; +import { RenovateConfig, getName, mocked } from '../../../../test/util'; import { getConfig } from '../../../config/defaults'; import * as _changelog from '../changelog'; import { branchifyUpgrades } from './branchify'; @@ -18,7 +18,7 @@ beforeEach(() => { config.warnings = []; }); -describe('workers/repository/updates/branchify', () => { +describe(getName(__filename), () => { 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 6312e0e025..4fb7190b04 100644 --- a/lib/workers/repository/updates/flatten.spec.ts +++ b/lib/workers/repository/updates/flatten.spec.ts @@ -1,4 +1,4 @@ -import { RenovateConfig, getConfig } from '../../../../test/util'; +import { RenovateConfig, getConfig, getName } from '../../../../test/util'; import { LANGUAGE_DOCKER } from '../../../constants/languages'; import { flattenUpdates } from './flatten'; @@ -11,7 +11,7 @@ beforeEach(() => { config.warnings = []; }); -describe('workers/repository/updates/flatten', () => { +describe(getName(__filename), () => { 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 ad56b9a8c3..53d6b12674 100644 --- a/lib/workers/repository/updates/generate.spec.ts +++ b/lib/workers/repository/updates/generate.spec.ts @@ -1,4 +1,4 @@ -import { defaultConfig, partial } from '../../../../test/util'; +import { defaultConfig, getName, partial } from '../../../../test/util'; import type { UpdateType } from '../../../config/types'; import * as datasourceNpm from '../../../datasource/npm'; import type { BranchUpgradeConfig } from '../../types'; @@ -8,7 +8,7 @@ beforeEach(() => { jest.resetAllMocks(); }); -describe('workers/repository/updates/generate', () => { +describe(getName(__filename), () => { 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 2e04be8f6a..5219209c13 100644 --- a/lib/workers/repository/util/commit-message.spec.ts +++ b/lib/workers/repository/util/commit-message.spec.ts @@ -1,9 +1,10 @@ +import { getName } from '../../../../test/util'; import { COMMIT_MESSAGE_PREFIX_SEPARATOR, formatCommitMessagePrefix, } from './commit-message'; -describe('workers/repository/util/commit-message', () => { +describe(getName(__filename), () => { describe('COMMIT_MESSAGE_PREFIX_END_CHARACTER', () => { it('is a colon character', () => { expect(COMMIT_MESSAGE_PREFIX_SEPARATOR).toBe(':'); -- GitLab