From 82fa5ce162913596be6160687c9d81b6490ee8be Mon Sep 17 00:00:00 2001 From: Sergei Zharinov Date: Wed, 14 Apr 2021 19:28:20 +0400 Subject: [PATCH] refactor(datasource): Enforce getName usage (#9524) --- .../cdnjs/__snapshots__/index.spec.ts.snap | 24 +++---- lib/datasource/cdnjs/index.spec.ts | 3 +- .../crate/__snapshots__/index.spec.ts.snap | 28 ++++---- lib/datasource/crate/index.spec.ts | 3 +- .../dart/__snapshots__/index.spec.ts.snap | 16 ++--- lib/datasource/dart/index.spec.ts | 3 +- .../galaxy/__snapshots__/index.spec.ts.snap | 22 +++---- lib/datasource/galaxy/index.spec.ts | 3 +- .../git-refs/__snapshots__/index.spec.ts.snap | 6 +- lib/datasource/git-refs/index.spec.ts | 3 +- .../git-tags/__snapshots__/index.spec.ts.snap | 6 +- lib/datasource/git-tags/index.spec.ts | 3 +- .../__snapshots__/index.spec.ts.snap | 8 +-- lib/datasource/github-releases/index.spec.ts | 3 +- .../__snapshots__/index.spec.ts.snap | 22 +++---- lib/datasource/github-tags/index.spec.ts | 3 +- .../__snapshots__/index.spec.ts.snap | 8 +-- lib/datasource/gitlab-tags/index.spec.ts | 3 +- .../go/__snapshots__/index.spec.ts.snap | 64 +++++++++---------- lib/datasource/go/index.spec.ts | 4 +- .../helm/__snapshots__/index.spec.ts.snap | 24 +++---- lib/datasource/helm/index.spec.ts | 3 +- .../hex/__snapshots__/index.spec.ts.snap | 24 +++---- lib/datasource/hex/index.spec.ts | 3 +- .../maven/__snapshots__/index.spec.ts.snap | 12 ++-- lib/datasource/maven/index.spec.ts | 3 +- lib/datasource/metadata.spec.ts | 3 +- .../nuget/__snapshots__/index.spec.ts.snap | 60 ++++++++--------- lib/datasource/nuget/index.spec.ts | 3 +- .../orb/__snapshots__/index.spec.ts.snap | 16 ++--- lib/datasource/orb/index.spec.ts | 3 +- .../__snapshots__/index.spec.ts.snap | 38 +++++------ lib/datasource/packagist/index.spec.ts | 3 +- .../pod/__snapshots__/index.spec.ts.snap | 12 ++-- lib/datasource/pod/index.spec.ts | 3 +- .../pypi/__snapshots__/index.spec.ts.snap | 48 +++++++------- lib/datasource/pypi/index.spec.ts | 3 +- .../__snapshots__/index.spec.ts.snap | 8 +-- lib/datasource/ruby-version/index.spec.ts | 3 +- .../rubygems/__snapshots__/index.spec.ts.snap | 22 +++---- lib/datasource/rubygems/index.spec.ts | 3 +- .../__snapshots__/index.spec.ts.snap | 4 +- lib/datasource/sbt-package/index.spec.ts | 3 +- .../__snapshots__/index.spec.ts.snap | 4 +- lib/datasource/sbt-plugin/index.spec.ts | 3 +- .../__snapshots__/index.spec.ts.snap | 22 +++---- lib/datasource/terraform-module/index.spec.ts | 3 +- .../__snapshots__/index.spec.ts.snap | 22 +++---- .../terraform-provider/index.spec.ts | 3 +- 49 files changed, 310 insertions(+), 286 deletions(-) diff --git a/lib/datasource/cdnjs/__snapshots__/index.spec.ts.snap b/lib/datasource/cdnjs/__snapshots__/index.spec.ts.snap index cbdcbeb8f504e0..99398206f31a35 100644 --- a/lib/datasource/cdnjs/__snapshots__/index.spec.ts.snap +++ b/lib/datasource/cdnjs/__snapshots__/index.spec.ts.snap @@ -1,6 +1,6 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP -exports[`datasource/cdnjs getReleases filters releases by asset presence 1`] = ` +exports[`datasource/cdnjs/index getReleases filters releases by asset presence 1`] = ` Object { "homepage": "http://bulma.io", "registryUrl": "https://api.cdnjs.com/", @@ -13,7 +13,7 @@ Object { } `; -exports[`datasource/cdnjs getReleases filters releases by asset presence 2`] = ` +exports[`datasource/cdnjs/index getReleases filters releases by asset presence 2`] = ` Array [ Object { "headers": Object { @@ -28,7 +28,7 @@ Array [ ] `; -exports[`datasource/cdnjs getReleases processes real data 1`] = ` +exports[`datasource/cdnjs/index getReleases processes real data 1`] = ` Object { "homepage": "https://d3js.org/d3-force/", "registryUrl": "https://api.cdnjs.com/", @@ -142,7 +142,7 @@ Object { } `; -exports[`datasource/cdnjs getReleases processes real data 2`] = ` +exports[`datasource/cdnjs/index getReleases processes real data 2`] = ` Array [ Object { "headers": Object { @@ -157,7 +157,7 @@ Array [ ] `; -exports[`datasource/cdnjs getReleases returns null for 404 1`] = ` +exports[`datasource/cdnjs/index getReleases returns null for 404 1`] = ` Array [ Object { "headers": Object { @@ -172,7 +172,7 @@ Array [ ] `; -exports[`datasource/cdnjs getReleases returns null for empty 200 OK 1`] = ` +exports[`datasource/cdnjs/index getReleases returns null for empty 200 OK 1`] = ` Array [ Object { "headers": Object { @@ -187,7 +187,7 @@ Array [ ] `; -exports[`datasource/cdnjs getReleases returns null for unknown error 1`] = ` +exports[`datasource/cdnjs/index getReleases returns null for unknown error 1`] = ` Array [ Object { "headers": Object { @@ -202,7 +202,7 @@ Array [ ] `; -exports[`datasource/cdnjs getReleases throws for 5xx 1`] = ` +exports[`datasource/cdnjs/index getReleases throws for 5xx 1`] = ` Array [ Object { "headers": Object { @@ -217,7 +217,7 @@ Array [ ] `; -exports[`datasource/cdnjs getReleases throws for 401 1`] = ` +exports[`datasource/cdnjs/index getReleases throws for 401 1`] = ` Array [ Object { "headers": Object { @@ -232,7 +232,7 @@ Array [ ] `; -exports[`datasource/cdnjs getReleases throws for 429 1`] = ` +exports[`datasource/cdnjs/index getReleases throws for 429 1`] = ` Array [ Object { "headers": Object { @@ -247,7 +247,7 @@ Array [ ] `; -exports[`datasource/cdnjs getReleases throws for empty result 1`] = ` +exports[`datasource/cdnjs/index getReleases throws for empty result 1`] = ` Array [ Object { "headers": Object { @@ -262,7 +262,7 @@ Array [ ] `; -exports[`datasource/cdnjs getReleases throws for error 1`] = ` +exports[`datasource/cdnjs/index getReleases throws for error 1`] = ` Array [ Object { "headers": Object { diff --git a/lib/datasource/cdnjs/index.spec.ts b/lib/datasource/cdnjs/index.spec.ts index eca564d8a17a7a..8535027de59767 100644 --- a/lib/datasource/cdnjs/index.spec.ts +++ b/lib/datasource/cdnjs/index.spec.ts @@ -1,6 +1,7 @@ import fs from 'fs'; import { getPkgReleases } from '..'; import * as httpMock from '../../../test/http-mock'; +import { getName } from '../../../test/util'; import { EXTERNAL_HOST_ERROR } from '../../constants/error-messages'; import { id as datasource } from '.'; @@ -21,7 +22,7 @@ const baseUrl = 'https://api.cdnjs.com/'; const pathFor = (s: string): string => `/libraries/${s.split('/').shift()}?fields=homepage,repository,assets`; -describe('datasource/cdnjs', () => { +describe(getName(__filename), () => { describe('getReleases', () => { beforeEach(() => { jest.clearAllMocks(); diff --git a/lib/datasource/crate/__snapshots__/index.spec.ts.snap b/lib/datasource/crate/__snapshots__/index.spec.ts.snap index ab4be51e18052e..93d5c027187043 100644 --- a/lib/datasource/crate/__snapshots__/index.spec.ts.snap +++ b/lib/datasource/crate/__snapshots__/index.spec.ts.snap @@ -1,6 +1,6 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP -exports[`datasource/crate getReleases clones cloudsmith private registry 1`] = ` +exports[`datasource/crate/index getReleases clones cloudsmith private registry 1`] = ` Object { "dependencyUrl": "https://cloudsmith.io/~myorg/repos/myrepo/packages/detail/cargo/mypkg", "registryUrl": "https://dl.cloudsmith.io/basic/myorg/myrepo/cargo/index.git", @@ -15,7 +15,7 @@ Object { } `; -exports[`datasource/crate getReleases clones other private registry 1`] = ` +exports[`datasource/crate/index getReleases clones other private registry 1`] = ` Object { "dependencyUrl": "https://github.com/mcorbin/testregistry/mypkg", "registryUrl": "https://github.com/mcorbin/testregistry", @@ -30,7 +30,7 @@ Object { } `; -exports[`datasource/crate getReleases processes real data: amethyst 1`] = ` +exports[`datasource/crate/index getReleases processes real data: amethyst 1`] = ` Object { "dependencyUrl": "https://crates.io/crates/amethyst", "registryUrl": "https://crates.io", @@ -97,7 +97,7 @@ Object { } `; -exports[`datasource/crate getReleases processes real data: amethyst 2`] = ` +exports[`datasource/crate/index getReleases processes real data: amethyst 2`] = ` Array [ Object { "headers": Object { @@ -111,7 +111,7 @@ Array [ ] `; -exports[`datasource/crate getReleases processes real data: libc 1`] = ` +exports[`datasource/crate/index getReleases processes real data: libc 1`] = ` Object { "dependencyUrl": "https://crates.io/crates/libc", "registryUrl": "https://crates.io", @@ -317,7 +317,7 @@ Object { } `; -exports[`datasource/crate getReleases processes real data: libc 2`] = ` +exports[`datasource/crate/index getReleases processes real data: libc 2`] = ` Array [ Object { "headers": Object { @@ -331,9 +331,9 @@ Array [ ] `; -exports[`datasource/crate getReleases refuses to clone if trustLevel is not high 1`] = `null`; +exports[`datasource/crate/index getReleases refuses to clone if trustLevel is not high 1`] = `null`; -exports[`datasource/crate getReleases returns null for 404 1`] = ` +exports[`datasource/crate/index getReleases returns null for 404 1`] = ` Array [ Object { "headers": Object { @@ -347,7 +347,7 @@ Array [ ] `; -exports[`datasource/crate getReleases returns null for empty list 1`] = ` +exports[`datasource/crate/index getReleases returns null for empty list 1`] = ` Array [ Object { "headers": Object { @@ -361,7 +361,7 @@ Array [ ] `; -exports[`datasource/crate getReleases returns null for empty result 1`] = ` +exports[`datasource/crate/index getReleases returns null for empty result 1`] = ` Array [ Object { "headers": Object { @@ -375,7 +375,7 @@ Array [ ] `; -exports[`datasource/crate getReleases returns null for missing fields 1`] = ` +exports[`datasource/crate/index getReleases returns null for missing fields 1`] = ` Array [ Object { "headers": Object { @@ -389,7 +389,7 @@ Array [ ] `; -exports[`datasource/crate getReleases returns null for unknown error 1`] = ` +exports[`datasource/crate/index getReleases returns null for unknown error 1`] = ` Array [ Object { "headers": Object { @@ -403,9 +403,9 @@ Array [ ] `; -exports[`datasource/crate getReleases throws for 5xx 1`] = `[Error: external-host-error]`; +exports[`datasource/crate/index getReleases throws for 5xx 1`] = `[Error: external-host-error]`; -exports[`datasource/crate getReleases throws for 5xx 2`] = ` +exports[`datasource/crate/index getReleases throws for 5xx 2`] = ` Array [ Object { "headers": Object { diff --git a/lib/datasource/crate/index.spec.ts b/lib/datasource/crate/index.spec.ts index 5b4c7f29538353..a83b9f6293da56 100644 --- a/lib/datasource/crate/index.spec.ts +++ b/lib/datasource/crate/index.spec.ts @@ -5,6 +5,7 @@ import { DirectoryResult, dir } from 'tmp-promise'; import { dirname, join } from 'upath'; import { getPkgReleases } from '..'; import * as httpMock from '../../../test/http-mock'; +import { getName } from '../../../test/util'; import { setAdminConfig } from '../../config/admin'; import * as memCache from '../../util/cache/memory'; import { setFsConfig } from '../../util/fs'; @@ -67,7 +68,7 @@ function setupErrorGitMock(): { mockClone: jest.Mock } { return { mockClone }; } -describe('datasource/crate', () => { +describe(getName(__filename), () => { describe('getIndexSuffix', () => { it('returns correct suffixes', () => { expect(getIndexSuffix('a')).toStrictEqual(['1', 'a']); diff --git a/lib/datasource/dart/__snapshots__/index.spec.ts.snap b/lib/datasource/dart/__snapshots__/index.spec.ts.snap index 8a45918113408b..5c7aee71bdc2ec 100644 --- a/lib/datasource/dart/__snapshots__/index.spec.ts.snap +++ b/lib/datasource/dart/__snapshots__/index.spec.ts.snap @@ -1,6 +1,6 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP -exports[`datasource/dart getReleases processes real data 1`] = ` +exports[`datasource/dart/index getReleases processes real data 1`] = ` Object { "registryUrl": "https://pub.dartlang.org/", "releases": Array [ @@ -185,7 +185,7 @@ Object { } `; -exports[`datasource/dart getReleases processes real data 2`] = ` +exports[`datasource/dart/index getReleases processes real data 2`] = ` Array [ Object { "headers": Object { @@ -200,7 +200,7 @@ Array [ ] `; -exports[`datasource/dart getReleases returns null for 404 1`] = ` +exports[`datasource/dart/index getReleases returns null for 404 1`] = ` Array [ Object { "headers": Object { @@ -215,7 +215,7 @@ Array [ ] `; -exports[`datasource/dart getReleases returns null for empty fields 1`] = ` +exports[`datasource/dart/index getReleases returns null for empty fields 1`] = ` Array [ Object { "headers": Object { @@ -240,7 +240,7 @@ Array [ ] `; -exports[`datasource/dart getReleases returns null for empty result 1`] = ` +exports[`datasource/dart/index getReleases returns null for empty result 1`] = ` Array [ Object { "headers": Object { @@ -255,7 +255,7 @@ Array [ ] `; -exports[`datasource/dart getReleases returns null for unknown error 1`] = ` +exports[`datasource/dart/index getReleases returns null for unknown error 1`] = ` Array [ Object { "headers": Object { @@ -270,9 +270,9 @@ Array [ ] `; -exports[`datasource/dart getReleases throws for 5xx 1`] = `[Error: external-host-error]`; +exports[`datasource/dart/index getReleases throws for 5xx 1`] = `[Error: external-host-error]`; -exports[`datasource/dart getReleases throws for 5xx 2`] = ` +exports[`datasource/dart/index getReleases throws for 5xx 2`] = ` Array [ Object { "headers": Object { diff --git a/lib/datasource/dart/index.spec.ts b/lib/datasource/dart/index.spec.ts index c85e08e2e2ca6c..5228b332bf5ca1 100644 --- a/lib/datasource/dart/index.spec.ts +++ b/lib/datasource/dart/index.spec.ts @@ -1,6 +1,7 @@ import fs from 'fs'; import { getPkgReleases } from '..'; import * as httpMock from '../../../test/http-mock'; +import { getName } from '../../../test/util'; import { id as datasource } from '.'; const body: any = JSON.parse( @@ -12,7 +13,7 @@ const body: any = JSON.parse( const baseUrl = 'https://pub.dartlang.org/api/packages/'; -describe('datasource/dart', () => { +describe(getName(__filename), () => { beforeEach(() => { httpMock.setup(); }); diff --git a/lib/datasource/galaxy/__snapshots__/index.spec.ts.snap b/lib/datasource/galaxy/__snapshots__/index.spec.ts.snap index b5390a300decf7..9f7c73b9d70fbb 100644 --- a/lib/datasource/galaxy/__snapshots__/index.spec.ts.snap +++ b/lib/datasource/galaxy/__snapshots__/index.spec.ts.snap @@ -1,6 +1,6 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP -exports[`datasource/galaxy getReleases processes real data 1`] = ` +exports[`datasource/galaxy/index getReleases processes real data 1`] = ` Object { "dependencyUrl": "https://galaxy.ansible.com/yatesr/timezone", "registryUrl": "https://galaxy.ansible.com/", @@ -22,7 +22,7 @@ Object { } `; -exports[`datasource/galaxy getReleases processes real data 2`] = ` +exports[`datasource/galaxy/index getReleases processes real data 2`] = ` Array [ Object { "headers": Object { @@ -36,7 +36,7 @@ Array [ ] `; -exports[`datasource/galaxy getReleases return null if searching random username and project name 1`] = ` +exports[`datasource/galaxy/index getReleases return null if searching random username and project name 1`] = ` Array [ Object { "headers": Object { @@ -50,7 +50,7 @@ Array [ ] `; -exports[`datasource/galaxy getReleases returns null for 404 1`] = ` +exports[`datasource/galaxy/index getReleases returns null for 404 1`] = ` Array [ Object { "headers": Object { @@ -64,7 +64,7 @@ Array [ ] `; -exports[`datasource/galaxy getReleases returns null for empty list 1`] = ` +exports[`datasource/galaxy/index getReleases returns null for empty list 1`] = ` Array [ Object { "headers": Object { @@ -78,7 +78,7 @@ Array [ ] `; -exports[`datasource/galaxy getReleases returns null for empty result 1`] = ` +exports[`datasource/galaxy/index getReleases returns null for empty result 1`] = ` Array [ Object { "headers": Object { @@ -92,7 +92,7 @@ Array [ ] `; -exports[`datasource/galaxy getReleases returns null for missing fields 1`] = ` +exports[`datasource/galaxy/index getReleases returns null for missing fields 1`] = ` Array [ Object { "headers": Object { @@ -106,7 +106,7 @@ Array [ ] `; -exports[`datasource/galaxy getReleases returns null for unknown error 1`] = ` +exports[`datasource/galaxy/index getReleases returns null for unknown error 1`] = ` Array [ Object { "headers": Object { @@ -120,9 +120,9 @@ Array [ ] `; -exports[`datasource/galaxy getReleases throws for 5xx 1`] = `[Error: external-host-error]`; +exports[`datasource/galaxy/index getReleases throws for 5xx 1`] = `[Error: external-host-error]`; -exports[`datasource/galaxy getReleases throws for 5xx 2`] = ` +exports[`datasource/galaxy/index getReleases throws for 5xx 2`] = ` Array [ Object { "headers": Object { @@ -136,7 +136,7 @@ Array [ ] `; -exports[`datasource/galaxy getReleases throws for 404 1`] = ` +exports[`datasource/galaxy/index getReleases throws for 404 1`] = ` Array [ Object { "headers": Object { diff --git a/lib/datasource/galaxy/index.spec.ts b/lib/datasource/galaxy/index.spec.ts index 636823249216ee..6fb54511189fad 100644 --- a/lib/datasource/galaxy/index.spec.ts +++ b/lib/datasource/galaxy/index.spec.ts @@ -1,6 +1,7 @@ import fs from 'fs'; import { getPkgReleases } from '..'; import * as httpMock from '../../../test/http-mock'; +import { getName } from '../../../test/util'; import { id as datasource } from '.'; @@ -15,7 +16,7 @@ const empty = fs.readFileSync( const baseUrl = 'https://galaxy.ansible.com/'; -describe('datasource/galaxy', () => { +describe(getName(__filename), () => { describe('getReleases', () => { beforeEach(() => { httpMock.setup(); diff --git a/lib/datasource/git-refs/__snapshots__/index.spec.ts.snap b/lib/datasource/git-refs/__snapshots__/index.spec.ts.snap index 860246290a5aaf..f5badb3701ba30 100644 --- a/lib/datasource/git-refs/__snapshots__/index.spec.ts.snap +++ b/lib/datasource/git-refs/__snapshots__/index.spec.ts.snap @@ -1,10 +1,10 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP -exports[`datasource/git-refs getDigest() returns digest for HEAD 1`] = `"a9920c014aebc28dc1b23e7efcc006d0455cc710"`; +exports[`datasource/git-refs/index getDigest() returns digest for HEAD 1`] = `"a9920c014aebc28dc1b23e7efcc006d0455cc710"`; -exports[`datasource/git-refs getDigest() returns digest for tag 1`] = `"2b52829c7c1bd65b3501c450849c53b90b11fa0e"`; +exports[`datasource/git-refs/index getDigest() returns digest for tag 1`] = `"2b52829c7c1bd65b3501c450849c53b90b11fa0e"`; -exports[`datasource/git-refs getReleases returns versions filtered from tags 1`] = ` +exports[`datasource/git-refs/index getReleases returns versions filtered from tags 1`] = ` Object { "releases": Array [ Object { diff --git a/lib/datasource/git-refs/index.spec.ts b/lib/datasource/git-refs/index.spec.ts index 07a607026678bb..c60b8eb241bbe2 100644 --- a/lib/datasource/git-refs/index.spec.ts +++ b/lib/datasource/git-refs/index.spec.ts @@ -1,6 +1,7 @@ import fs from 'fs-extra'; import _simpleGit from 'simple-git'; import { getPkgReleases } from '..'; +import { getName } from '../../../test/util'; import { id as datasource, getDigest } from '.'; jest.mock('simple-git'); @@ -13,7 +14,7 @@ const lsRemote1 = fs.readFileSync( 'utf8' ); -describe('datasource/git-refs', () => { +describe(getName(__filename), () => { describe('getReleases', () => { it('returns nil if response is wrong', async () => { simpleGit.mockReturnValue({ diff --git a/lib/datasource/git-tags/__snapshots__/index.spec.ts.snap b/lib/datasource/git-tags/__snapshots__/index.spec.ts.snap index f938f576964c2a..d4ffe6b36df0de 100644 --- a/lib/datasource/git-tags/__snapshots__/index.spec.ts.snap +++ b/lib/datasource/git-tags/__snapshots__/index.spec.ts.snap @@ -1,10 +1,10 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP -exports[`datasource/git-tags getDigest() returns digest for HEAD 1`] = `"a9920c014aebc28dc1b23e7efcc006d0455cc710"`; +exports[`datasource/git-tags/index getDigest() returns digest for HEAD 1`] = `"a9920c014aebc28dc1b23e7efcc006d0455cc710"`; -exports[`datasource/git-tags getDigest() returns digest for tag 1`] = `"9cb93e0b236385a4e2efd089d7c6a458f5ff321f"`; +exports[`datasource/git-tags/index getDigest() returns digest for tag 1`] = `"9cb93e0b236385a4e2efd089d7c6a458f5ff321f"`; -exports[`datasource/git-tags getReleases returns versions filtered from tags 1`] = ` +exports[`datasource/git-tags/index getReleases returns versions filtered from tags 1`] = ` Object { "releases": Array [ Object { diff --git a/lib/datasource/git-tags/index.spec.ts b/lib/datasource/git-tags/index.spec.ts index 183371c737b01e..c449c78d429562 100644 --- a/lib/datasource/git-tags/index.spec.ts +++ b/lib/datasource/git-tags/index.spec.ts @@ -1,6 +1,7 @@ import fs from 'fs-extra'; import _simpleGit from 'simple-git'; import { getPkgReleases } from '..'; +import { getName } from '../../../test/util'; import { id as datasource, getDigest } from '.'; jest.mock('simple-git'); @@ -13,7 +14,7 @@ const lsRemote1 = fs.readFileSync( 'utf8' ); -describe('datasource/git-tags', () => { +describe(getName(__filename), () => { describe('getReleases', () => { it('returns nil if response is wrong', async () => { simpleGit.mockReturnValue({ diff --git a/lib/datasource/github-releases/__snapshots__/index.spec.ts.snap b/lib/datasource/github-releases/__snapshots__/index.spec.ts.snap index 93a88beee1bdcc..0acbadabf69fad 100644 --- a/lib/datasource/github-releases/__snapshots__/index.spec.ts.snap +++ b/lib/datasource/github-releases/__snapshots__/index.spec.ts.snap @@ -1,6 +1,6 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP -exports[`datasource/github-releases getReleases returns releases 1`] = ` +exports[`datasource/github-releases/index getReleases returns releases 1`] = ` Object { "registryUrl": "https://github.com", "releases": Array [ @@ -25,7 +25,7 @@ Object { } `; -exports[`datasource/github-releases getReleases returns releases 2`] = ` +exports[`datasource/github-releases/index getReleases returns releases 2`] = ` Array [ Object { "headers": Object { @@ -41,7 +41,7 @@ Array [ ] `; -exports[`datasource/github-releases getReleases supports ghe 1`] = ` +exports[`datasource/github-releases/index getReleases supports ghe 1`] = ` Object { "releases": Array [ Object { @@ -79,7 +79,7 @@ Object { } `; -exports[`datasource/github-releases getReleases supports ghe 2`] = ` +exports[`datasource/github-releases/index getReleases supports ghe 2`] = ` Array [ Object { "headers": Object { diff --git a/lib/datasource/github-releases/index.spec.ts b/lib/datasource/github-releases/index.spec.ts index e7a9bc6909c4c3..ff5a412431c758 100644 --- a/lib/datasource/github-releases/index.spec.ts +++ b/lib/datasource/github-releases/index.spec.ts @@ -1,5 +1,6 @@ import { getPkgReleases } from '..'; import * as httpMock from '../../../test/http-mock'; +import { getName } from '../../../test/util'; import * as _hostRules from '../../util/host-rules'; import { id as datasource } from '.'; import * as github from '.'; @@ -22,7 +23,7 @@ const responseBody = [ }, ]; -describe('datasource/github-releases', () => { +describe(getName(__filename), () => { beforeEach(() => { hostRules.hosts.mockReturnValue([]); hostRules.find.mockReturnValue({ diff --git a/lib/datasource/github-tags/__snapshots__/index.spec.ts.snap b/lib/datasource/github-tags/__snapshots__/index.spec.ts.snap index b28f93e59b3bf0..0ff5fa3c868dd6 100644 --- a/lib/datasource/github-tags/__snapshots__/index.spec.ts.snap +++ b/lib/datasource/github-tags/__snapshots__/index.spec.ts.snap @@ -1,6 +1,6 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP -exports[`datasource/github-tags getDigest returns commit digest 1`] = ` +exports[`datasource/github-tags/index getDigest returns commit digest 1`] = ` Array [ Object { "headers": Object { @@ -16,7 +16,7 @@ Array [ ] `; -exports[`datasource/github-tags getDigest returns digest 1`] = ` +exports[`datasource/github-tags/index getDigest returns digest 1`] = ` Array [ Object { "headers": Object { @@ -32,7 +32,7 @@ Array [ ] `; -exports[`datasource/github-tags getDigest returns null for missed tagged digest 1`] = ` +exports[`datasource/github-tags/index getDigest returns null for missed tagged digest 1`] = ` Array [ Object { "headers": Object { @@ -48,7 +48,7 @@ Array [ ] `; -exports[`datasource/github-tags getDigest returns null if no token 1`] = ` +exports[`datasource/github-tags/index getDigest returns null if no token 1`] = ` Array [ Object { "headers": Object { @@ -64,7 +64,7 @@ Array [ ] `; -exports[`datasource/github-tags getDigest returns tagged commit digest 1`] = ` +exports[`datasource/github-tags/index getDigest returns tagged commit digest 1`] = ` Array [ Object { "headers": Object { @@ -91,7 +91,7 @@ Array [ ] `; -exports[`datasource/github-tags getDigest supports ghe 1`] = ` +exports[`datasource/github-tags/index getDigest supports ghe 1`] = ` Array [ Object { "headers": Object { @@ -118,7 +118,7 @@ Array [ ] `; -exports[`datasource/github-tags getDigest warns if unknown ref 1`] = ` +exports[`datasource/github-tags/index getDigest warns if unknown ref 1`] = ` Array [ Object { "headers": Object { @@ -134,7 +134,7 @@ Array [ ] `; -exports[`datasource/github-tags getReleases returns tags 1`] = ` +exports[`datasource/github-tags/index getReleases returns tags 1`] = ` Object { "registryUrl": "https://github.com", "releases": Array [ @@ -154,7 +154,7 @@ Object { } `; -exports[`datasource/github-tags getReleases returns tags 2`] = ` +exports[`datasource/github-tags/index getReleases returns tags 2`] = ` Array [ Object { "headers": Object { @@ -181,7 +181,7 @@ Array [ ] `; -exports[`datasource/github-tags getReleases supports ghe 1`] = ` +exports[`datasource/github-tags/index getReleases supports ghe 1`] = ` Object { "releases": Array [ Object { @@ -197,7 +197,7 @@ Object { } `; -exports[`datasource/github-tags getReleases supports ghe 2`] = ` +exports[`datasource/github-tags/index getReleases supports ghe 2`] = ` Array [ Object { "headers": Object { diff --git a/lib/datasource/github-tags/index.spec.ts b/lib/datasource/github-tags/index.spec.ts index 34f9e34f3f507e..06992b6c260177 100644 --- a/lib/datasource/github-tags/index.spec.ts +++ b/lib/datasource/github-tags/index.spec.ts @@ -1,5 +1,6 @@ import { getPkgReleases } from '..'; import * as httpMock from '../../../test/http-mock'; +import { getName } from '../../../test/util'; import * as _hostRules from '../../util/host-rules'; import * as github from '.'; @@ -9,7 +10,7 @@ const hostRules: any = _hostRules; const githubApiHost = 'https://api.github.com'; const githubEnterpriseApiHost = 'https://git.enterprise.com'; -describe('datasource/github-tags', () => { +describe(getName(__filename), () => { beforeEach(() => { httpMock.reset(); httpMock.setup(); diff --git a/lib/datasource/gitlab-tags/__snapshots__/index.spec.ts.snap b/lib/datasource/gitlab-tags/__snapshots__/index.spec.ts.snap index 6dce70578ac71c..3e49f3c86144e9 100644 --- a/lib/datasource/gitlab-tags/__snapshots__/index.spec.ts.snap +++ b/lib/datasource/gitlab-tags/__snapshots__/index.spec.ts.snap @@ -1,6 +1,6 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP -exports[`datasource/gitlab-tags getReleases returns tags from custom registry 1`] = ` +exports[`datasource/gitlab-tags/index getReleases returns tags from custom registry 1`] = ` Object { "registryUrl": "https://gitlab.company.com/api/v4/", "releases": Array [ @@ -22,7 +22,7 @@ Object { } `; -exports[`datasource/gitlab-tags getReleases returns tags from custom registry 2`] = ` +exports[`datasource/gitlab-tags/index getReleases returns tags from custom registry 2`] = ` Array [ Object { "headers": Object { @@ -37,7 +37,7 @@ Array [ ] `; -exports[`datasource/gitlab-tags getReleases returns tags with default registry 1`] = ` +exports[`datasource/gitlab-tags/index getReleases returns tags with default registry 1`] = ` Object { "registryUrl": "https://gitlab.com", "releases": Array [ @@ -54,7 +54,7 @@ Object { } `; -exports[`datasource/gitlab-tags getReleases returns tags with default registry 2`] = ` +exports[`datasource/gitlab-tags/index getReleases returns tags with default registry 2`] = ` Array [ Object { "headers": Object { diff --git a/lib/datasource/gitlab-tags/index.spec.ts b/lib/datasource/gitlab-tags/index.spec.ts index e1eba98e5a5f02..f1b08eb58306c9 100644 --- a/lib/datasource/gitlab-tags/index.spec.ts +++ b/lib/datasource/gitlab-tags/index.spec.ts @@ -1,8 +1,9 @@ import { getPkgReleases } from '..'; import * as httpMock from '../../../test/http-mock'; +import { getName } from '../../../test/util'; import { id as datasource } from '.'; -describe('datasource/gitlab-tags', () => { +describe(getName(__filename), () => { beforeEach(() => { httpMock.reset(); httpMock.setup(); diff --git a/lib/datasource/go/__snapshots__/index.spec.ts.snap b/lib/datasource/go/__snapshots__/index.spec.ts.snap index 7fffc7b10b3a73..f772770f353377 100644 --- a/lib/datasource/go/__snapshots__/index.spec.ts.snap +++ b/lib/datasource/go/__snapshots__/index.spec.ts.snap @@ -1,6 +1,6 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP -exports[`datasource/go getDigest gitlab digest is not supported at the moment 1`] = ` +exports[`datasource/go/index getDigest gitlab digest is not supported at the moment 1`] = ` Array [ Object { "headers": Object { @@ -14,7 +14,7 @@ Array [ ] `; -exports[`datasource/go getDigest returns digest 1`] = ` +exports[`datasource/go/index getDigest returns digest 1`] = ` Array [ Object { "headers": Object { @@ -38,7 +38,7 @@ Array [ ] `; -exports[`datasource/go getDigest returns null for no go-source tag 1`] = ` +exports[`datasource/go/index getDigest returns null for no go-source tag 1`] = ` Array [ Object { "headers": Object { @@ -52,7 +52,7 @@ Array [ ] `; -exports[`datasource/go getDigest returns null for wrong name 1`] = ` +exports[`datasource/go/index getDigest returns null for wrong name 1`] = ` Array [ Object { "headers": Object { @@ -66,9 +66,9 @@ Array [ ] `; -exports[`datasource/go getDigest support bitbucket digest 1`] = `"123"`; +exports[`datasource/go/index getDigest support bitbucket digest 1`] = `"123"`; -exports[`datasource/go getDigest support bitbucket digest 2`] = ` +exports[`datasource/go/index getDigest support bitbucket digest 2`] = ` Array [ Object { "headers": Object { @@ -93,7 +93,7 @@ Array [ ] `; -exports[`datasource/go getReleases handles fyne.io 1`] = ` +exports[`datasource/go/index getReleases handles fyne.io 1`] = ` Object { "releases": Array [ Object { @@ -109,7 +109,7 @@ Object { } `; -exports[`datasource/go getReleases handles fyne.io 2`] = ` +exports[`datasource/go/index getReleases handles fyne.io 2`] = ` Array [ Object { "headers": Object { @@ -143,7 +143,7 @@ Array [ ] `; -exports[`datasource/go getReleases processes real data 1`] = ` +exports[`datasource/go/index getReleases processes real data 1`] = ` Object { "releases": Array [ Object { @@ -159,7 +159,7 @@ Object { } `; -exports[`datasource/go getReleases processes real data 2`] = ` +exports[`datasource/go/index getReleases processes real data 2`] = ` Array [ Object { "headers": Object { @@ -193,7 +193,7 @@ Array [ ] `; -exports[`datasource/go getReleases returns none if no tags match submodules 1`] = ` +exports[`datasource/go/index getReleases returns none if no tags match submodules 1`] = ` Array [ Object { "headers": Object { @@ -218,7 +218,7 @@ Array [ ] `; -exports[`datasource/go getReleases returns none if no tags match submodules 2`] = ` +exports[`datasource/go/index getReleases returns none if no tags match submodules 2`] = ` Array [ Object { "headers": Object { @@ -243,7 +243,7 @@ Array [ ] `; -exports[`datasource/go getReleases returns null for 404 1`] = ` +exports[`datasource/go/index getReleases returns null for 404 1`] = ` Array [ Object { "headers": Object { @@ -257,7 +257,7 @@ Array [ ] `; -exports[`datasource/go getReleases returns null for empty result 1`] = ` +exports[`datasource/go/index getReleases returns null for empty result 1`] = ` Array [ Object { "headers": Object { @@ -271,7 +271,7 @@ Array [ ] `; -exports[`datasource/go getReleases returns null for go-import prefix mismatch 1`] = ` +exports[`datasource/go/index getReleases returns null for go-import prefix mismatch 1`] = ` Array [ Object { "headers": Object { @@ -285,7 +285,7 @@ Array [ ] `; -exports[`datasource/go getReleases returns null for unknown error 1`] = ` +exports[`datasource/go/index getReleases returns null for unknown error 1`] = ` Array [ Object { "headers": Object { @@ -299,7 +299,7 @@ Array [ ] `; -exports[`datasource/go getReleases skips unsupported platform 1`] = ` +exports[`datasource/go/index getReleases skips unsupported platform 1`] = ` Array [ Object { "headers": Object { @@ -313,7 +313,7 @@ Array [ ] `; -exports[`datasource/go getReleases skips wrong package 1`] = ` +exports[`datasource/go/index getReleases skips wrong package 1`] = ` Array [ Object { "headers": Object { @@ -327,7 +327,7 @@ Array [ ] `; -exports[`datasource/go getReleases support bitbucket tags 1`] = ` +exports[`datasource/go/index getReleases support bitbucket tags 1`] = ` Object { "releases": Array [ Object { @@ -343,7 +343,7 @@ Object { } `; -exports[`datasource/go getReleases support bitbucket tags 2`] = ` +exports[`datasource/go/index getReleases support bitbucket tags 2`] = ` Array [ Object { "headers": Object { @@ -358,7 +358,7 @@ Array [ ] `; -exports[`datasource/go getReleases support ghe 1`] = ` +exports[`datasource/go/index getReleases support ghe 1`] = ` Object { "releases": Array [ Object { @@ -374,7 +374,7 @@ Object { } `; -exports[`datasource/go getReleases support ghe 2`] = ` +exports[`datasource/go/index getReleases support ghe 2`] = ` Array [ Object { "headers": Object { @@ -408,7 +408,7 @@ Array [ ] `; -exports[`datasource/go getReleases support gitlab 1`] = ` +exports[`datasource/go/index getReleases support gitlab 1`] = ` Object { "releases": Array [ Object { @@ -424,7 +424,7 @@ Object { } `; -exports[`datasource/go getReleases support gitlab 2`] = ` +exports[`datasource/go/index getReleases support gitlab 2`] = ` Array [ Object { "headers": Object { @@ -448,7 +448,7 @@ Array [ ] `; -exports[`datasource/go getReleases support self hosted gitlab private repositories 1`] = ` +exports[`datasource/go/index getReleases support self hosted gitlab private repositories 1`] = ` Object { "releases": Array [ Object { @@ -464,7 +464,7 @@ Object { } `; -exports[`datasource/go getReleases support self hosted gitlab private repositories 2`] = ` +exports[`datasource/go/index getReleases support self hosted gitlab private repositories 2`] = ` Array [ Object { "headers": Object { @@ -490,9 +490,9 @@ Array [ ] `; -exports[`datasource/go getReleases unknown datasource returns null 1`] = `null`; +exports[`datasource/go/index getReleases unknown datasource returns null 1`] = `null`; -exports[`datasource/go getReleases unknown datasource returns null 2`] = ` +exports[`datasource/go/index getReleases unknown datasource returns null 2`] = ` Array [ Object { "headers": Object { @@ -506,7 +506,7 @@ Array [ ] `; -exports[`datasource/go getReleases works for known servers 1`] = ` +exports[`datasource/go/index getReleases works for known servers 1`] = ` Array [ Object { "headers": Object { @@ -571,7 +571,7 @@ Array [ ] `; -exports[`datasource/go getReleases works for nested modules on github 1`] = ` +exports[`datasource/go/index getReleases works for nested modules on github 1`] = ` Array [ Object { "headers": Object { @@ -596,7 +596,7 @@ Array [ ] `; -exports[`datasource/go getReleases works for nested modules on github 2`] = ` +exports[`datasource/go/index getReleases works for nested modules on github 2`] = ` Array [ Object { "headers": Object { @@ -621,7 +621,7 @@ Array [ ] `; -exports[`datasource/go getReleases works for nested modules on github v2+ major upgrades 1`] = ` +exports[`datasource/go/index getReleases works for nested modules on github v2+ major upgrades 1`] = ` Array [ Object { "headers": Object { diff --git a/lib/datasource/go/index.spec.ts b/lib/datasource/go/index.spec.ts index 1c3ad871a24213..fe7340408fe7a5 100644 --- a/lib/datasource/go/index.spec.ts +++ b/lib/datasource/go/index.spec.ts @@ -1,6 +1,6 @@ import { getPkgReleases } from '..'; import * as httpMock from '../../../test/http-mock'; -import { logger, mocked } from '../../../test/util'; +import { getName, logger, mocked } from '../../../test/util'; import * as _hostRules from '../../util/host-rules'; import { id as datasource, getDigest } from '.'; @@ -46,7 +46,7 @@ const resGitHubEnterprise = ` `; -describe('datasource/go', () => { +describe(getName(__filename), () => { beforeEach(() => { httpMock.setup(); hostRules.find.mockReturnValue({}); diff --git a/lib/datasource/helm/__snapshots__/index.spec.ts.snap b/lib/datasource/helm/__snapshots__/index.spec.ts.snap index b0efc56dd653e9..b3ef0477d3ec16 100644 --- a/lib/datasource/helm/__snapshots__/index.spec.ts.snap +++ b/lib/datasource/helm/__snapshots__/index.spec.ts.snap @@ -1,6 +1,6 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP -exports[`datasource/helm getReleases adds trailing slash to subdirectories 1`] = ` +exports[`datasource/helm/index getReleases adds trailing slash to subdirectories 1`] = ` Array [ Object { "headers": Object { @@ -14,7 +14,7 @@ Array [ ] `; -exports[`datasource/helm getReleases returns list of versions for normal response 1`] = ` +exports[`datasource/helm/index getReleases returns list of versions for normal response 1`] = ` Object { "homepage": "https://www.getambassador.io/", "registryUrl": "https://example-repository.com", @@ -132,7 +132,7 @@ Object { } `; -exports[`datasource/helm getReleases returns list of versions for normal response 2`] = ` +exports[`datasource/helm/index getReleases returns list of versions for normal response 2`] = ` Array [ Object { "headers": Object { @@ -146,7 +146,7 @@ Array [ ] `; -exports[`datasource/helm getReleases returns null for 404 1`] = ` +exports[`datasource/helm/index getReleases returns null for 404 1`] = ` Array [ Object { "headers": Object { @@ -160,7 +160,7 @@ Array [ ] `; -exports[`datasource/helm getReleases returns null for empty response 1`] = ` +exports[`datasource/helm/index getReleases returns null for empty response 1`] = ` Array [ Object { "headers": Object { @@ -174,7 +174,7 @@ Array [ ] `; -exports[`datasource/helm getReleases returns null for missing response body 1`] = ` +exports[`datasource/helm/index getReleases returns null for missing response body 1`] = ` Array [ Object { "headers": Object { @@ -188,7 +188,7 @@ Array [ ] `; -exports[`datasource/helm getReleases returns null for unknown error 1`] = ` +exports[`datasource/helm/index getReleases returns null for unknown error 1`] = ` Array [ Object { "headers": Object { @@ -202,7 +202,7 @@ Array [ ] `; -exports[`datasource/helm getReleases returns null if index.yaml in response is empty 1`] = ` +exports[`datasource/helm/index getReleases returns null if index.yaml in response is empty 1`] = ` Array [ Object { "headers": Object { @@ -216,7 +216,7 @@ Array [ ] `; -exports[`datasource/helm getReleases returns null if index.yaml in response is invalid 1`] = ` +exports[`datasource/helm/index getReleases returns null if index.yaml in response is invalid 1`] = ` Array [ Object { "headers": Object { @@ -230,7 +230,7 @@ Array [ ] `; -exports[`datasource/helm getReleases returns null if lookupName is not in index.yaml 1`] = ` +exports[`datasource/helm/index getReleases returns null if lookupName is not in index.yaml 1`] = ` Array [ Object { "headers": Object { @@ -244,9 +244,9 @@ Array [ ] `; -exports[`datasource/helm getReleases throws for 5xx 1`] = `[Error: external-host-error]`; +exports[`datasource/helm/index getReleases throws for 5xx 1`] = `[Error: external-host-error]`; -exports[`datasource/helm getReleases throws for 5xx 2`] = ` +exports[`datasource/helm/index getReleases throws for 5xx 2`] = ` Array [ Object { "headers": Object { diff --git a/lib/datasource/helm/index.spec.ts b/lib/datasource/helm/index.spec.ts index f9f7e51ab96d30..5e572990251bee 100644 --- a/lib/datasource/helm/index.spec.ts +++ b/lib/datasource/helm/index.spec.ts @@ -1,6 +1,7 @@ import fs from 'fs'; import { getPkgReleases } from '..'; import * as httpMock from '../../../test/http-mock'; +import { getName } from '../../../test/util'; import { id as datasource } from '.'; // Truncated index.yaml file @@ -9,7 +10,7 @@ const indexYaml = fs.readFileSync( 'utf8' ); -describe('datasource/helm', () => { +describe(getName(__filename), () => { describe('getReleases', () => { beforeEach(() => { jest.resetAllMocks(); diff --git a/lib/datasource/hex/__snapshots__/index.spec.ts.snap b/lib/datasource/hex/__snapshots__/index.spec.ts.snap index 4d01894b46d489..37b45ff3c43290 100644 --- a/lib/datasource/hex/__snapshots__/index.spec.ts.snap +++ b/lib/datasource/hex/__snapshots__/index.spec.ts.snap @@ -1,6 +1,6 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP -exports[`datasource/hex getReleases process public repo without auth 1`] = ` +exports[`datasource/hex/index getReleases process public repo without auth 1`] = ` Object { "homepage": "https://hex.pm/packages/certifi", "registryUrl": "https://hex.pm/", @@ -89,7 +89,7 @@ Object { } `; -exports[`datasource/hex getReleases process public repo without auth 2`] = ` +exports[`datasource/hex/index getReleases process public repo without auth 2`] = ` Array [ Object { "headers": Object { @@ -104,7 +104,7 @@ Array [ ] `; -exports[`datasource/hex getReleases processes real data 1`] = ` +exports[`datasource/hex/index getReleases processes real data 1`] = ` Object { "homepage": "https://hex.pm/packages/certifi", "registryUrl": "https://hex.pm/", @@ -193,7 +193,7 @@ Object { } `; -exports[`datasource/hex getReleases processes real data 2`] = ` +exports[`datasource/hex/index getReleases processes real data 2`] = ` Array [ Object { "headers": Object { @@ -208,7 +208,7 @@ Array [ ] `; -exports[`datasource/hex getReleases returns null for 401 1`] = ` +exports[`datasource/hex/index getReleases returns null for 401 1`] = ` Array [ Object { "headers": Object { @@ -223,7 +223,7 @@ Array [ ] `; -exports[`datasource/hex getReleases returns null for 404 1`] = ` +exports[`datasource/hex/index getReleases returns null for 404 1`] = ` Array [ Object { "headers": Object { @@ -238,7 +238,7 @@ Array [ ] `; -exports[`datasource/hex getReleases returns null for empty result 1`] = ` +exports[`datasource/hex/index getReleases returns null for empty result 1`] = ` Array [ Object { "headers": Object { @@ -253,7 +253,7 @@ Array [ ] `; -exports[`datasource/hex getReleases returns null for missing fields 1`] = ` +exports[`datasource/hex/index getReleases returns null for missing fields 1`] = ` Array [ Object { "headers": Object { @@ -268,7 +268,7 @@ Array [ ] `; -exports[`datasource/hex getReleases returns null for unknown error 1`] = ` +exports[`datasource/hex/index getReleases returns null for unknown error 1`] = ` Array [ Object { "headers": Object { @@ -283,7 +283,7 @@ Array [ ] `; -exports[`datasource/hex getReleases returns null with wrong auth token 1`] = ` +exports[`datasource/hex/index getReleases returns null with wrong auth token 1`] = ` Array [ Object { "headers": Object { @@ -299,7 +299,7 @@ Array [ ] `; -exports[`datasource/hex getReleases throws for 5xx 1`] = ` +exports[`datasource/hex/index getReleases throws for 5xx 1`] = ` Array [ Object { "headers": Object { @@ -314,7 +314,7 @@ Array [ ] `; -exports[`datasource/hex getReleases throws for 429 1`] = ` +exports[`datasource/hex/index getReleases throws for 429 1`] = ` Array [ Object { "headers": Object { diff --git a/lib/datasource/hex/index.spec.ts b/lib/datasource/hex/index.spec.ts index 17dc31081de21d..44f72778b8f92d 100644 --- a/lib/datasource/hex/index.spec.ts +++ b/lib/datasource/hex/index.spec.ts @@ -1,6 +1,7 @@ import fs from 'fs'; import { getPkgReleases } from '..'; import * as httpMock from '../../../test/http-mock'; +import { getName } from '../../../test/util'; import { EXTERNAL_HOST_ERROR } from '../../constants/error-messages'; import * as _hostRules from '../../util/host-rules'; import { id as datasource } from '.'; @@ -17,7 +18,7 @@ jest.mock('../../util/host-rules'); const baseUrl = 'https://hex.pm/api/packages/'; -describe('datasource/hex', () => { +describe(getName(__filename), () => { beforeEach(() => { hostRules.hosts.mockReturnValue([]); hostRules.find.mockReturnValue({}); diff --git a/lib/datasource/maven/__snapshots__/index.spec.ts.snap b/lib/datasource/maven/__snapshots__/index.spec.ts.snap index 16a6c252856835..ddedb1b554257c 100644 --- a/lib/datasource/maven/__snapshots__/index.spec.ts.snap +++ b/lib/datasource/maven/__snapshots__/index.spec.ts.snap @@ -1,6 +1,6 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP -exports[`datasource/maven getReleases should return all versions from a custom repository 1`] = ` +exports[`datasource/maven/index getReleases should return all versions from a custom repository 1`] = ` Object { "display": "mysql:mysql-connector-java", "group": "mysql", @@ -34,7 +34,7 @@ Object { } `; -exports[`datasource/maven getReleases should return all versions of a specific library if a repository fails 1`] = ` +exports[`datasource/maven/index getReleases should return all versions of a specific library if a repository fails 1`] = ` Array [ Object { "releaseTimestamp": "2020-01-01T00:00:00.650Z", @@ -59,7 +59,7 @@ Array [ ] `; -exports[`datasource/maven getReleases should return all versions of a specific library if a repository fails because invalid metadata file is found in another repository 1`] = ` +exports[`datasource/maven/index getReleases should return all versions of a specific library if a repository fails because invalid metadata file is found in another repository 1`] = ` Object { "display": "mysql:mysql-connector-java", "group": "mysql", @@ -90,7 +90,7 @@ Object { } `; -exports[`datasource/maven getReleases should return all versions of a specific library if a repository fails because invalid protocol 1`] = ` +exports[`datasource/maven/index getReleases should return all versions of a specific library if a repository fails because invalid protocol 1`] = ` Array [ Object { "releaseTimestamp": "2020-01-01T00:00:00.650Z", @@ -115,7 +115,7 @@ Array [ ] `; -exports[`datasource/maven getReleases should return versions in all repositories for a specific library 1`] = ` +exports[`datasource/maven/index getReleases should return versions in all repositories for a specific library 1`] = ` Object { "display": "mysql:mysql-connector-java", "group": "mysql", @@ -159,7 +159,7 @@ Object { } `; -exports[`datasource/maven getReleases should simply return all versions of a specific library 1`] = ` +exports[`datasource/maven/index getReleases should simply return all versions of a specific library 1`] = ` Array [ Object { "version": "1.1", diff --git a/lib/datasource/maven/index.spec.ts b/lib/datasource/maven/index.spec.ts index 5e86b378be2153..9eb446dbf8816e 100644 --- a/lib/datasource/maven/index.spec.ts +++ b/lib/datasource/maven/index.spec.ts @@ -2,6 +2,7 @@ import fs from 'fs'; import nock from 'nock'; import { resolve } from 'upath'; import { Release, getPkgReleases } from '..'; +import { getName } from '../../../test/util'; import { EXTERNAL_HOST_ERROR } from '../../constants/error-messages'; import * as hostRules from '../../util/host-rules'; import * as mavenVersioning from '../../versioning/maven'; @@ -45,7 +46,7 @@ function generateReleases(versions: string[], ts = false): Release[] { }); } -describe('datasource/maven', () => { +describe(getName(__filename), () => { beforeEach(() => { hostRules.add({ hostType: datasource, diff --git a/lib/datasource/metadata.spec.ts b/lib/datasource/metadata.spec.ts index f28a6aa0ff1dc9..add5b5fb204367 100644 --- a/lib/datasource/metadata.spec.ts +++ b/lib/datasource/metadata.spec.ts @@ -1,9 +1,10 @@ +import { getName } from '../../test/util'; import * as datasourceMaven from './maven'; import { addMetaData } from './metadata'; import * as datasourceNpm from './npm'; import * as datasourcePypi from './pypi'; -describe('datasource/metadata', () => { +describe(getName(__filename), () => { it('Should do nothing if dep is not specified', () => { expect(addMetaData()).toBeUndefined(); }); diff --git a/lib/datasource/nuget/__snapshots__/index.spec.ts.snap b/lib/datasource/nuget/__snapshots__/index.spec.ts.snap index dd435708213b07..f104bd2ee93532 100644 --- a/lib/datasource/nuget/__snapshots__/index.spec.ts.snap +++ b/lib/datasource/nuget/__snapshots__/index.spec.ts.snap @@ -1,6 +1,6 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP -exports[`datasource/nuget getReleases can't get packages list (v3) 1`] = ` +exports[`datasource/nuget/index getReleases can't get packages list (v3) 1`] = ` Array [ Object { "headers": Object { @@ -25,7 +25,7 @@ Array [ ] `; -exports[`datasource/nuget getReleases empty packages list (v3) 1`] = ` +exports[`datasource/nuget/index getReleases empty packages list (v3) 1`] = ` Array [ Object { "headers": Object { @@ -50,7 +50,7 @@ Array [ ] `; -exports[`datasource/nuget getReleases extracts feed version from registry URL hash 1`] = ` +exports[`datasource/nuget/index getReleases extracts feed version from registry URL hash 1`] = ` Array [ Object { "headers": Object { @@ -65,7 +65,7 @@ Array [ ] `; -exports[`datasource/nuget getReleases handles paginated results (v2) 1`] = ` +exports[`datasource/nuget/index getReleases handles paginated results (v2) 1`] = ` Object { "registryUrl": "https://www.nuget.org/api/v2/", "releases": Array [ @@ -79,7 +79,7 @@ Object { } `; -exports[`datasource/nuget getReleases handles paginated results (v2) 2`] = ` +exports[`datasource/nuget/index getReleases handles paginated results (v2) 2`] = ` Array [ Object { "headers": Object { @@ -102,7 +102,7 @@ Array [ ] `; -exports[`datasource/nuget getReleases processes real data (v2) 1`] = ` +exports[`datasource/nuget/index getReleases processes real data (v2) 1`] = ` Object { "registryUrl": "https://www.nuget.org/api/v2/", "releases": Array [ @@ -291,7 +291,7 @@ Object { } `; -exports[`datasource/nuget getReleases processes real data (v2) 2`] = ` +exports[`datasource/nuget/index getReleases processes real data (v2) 2`] = ` Array [ Object { "headers": Object { @@ -305,7 +305,7 @@ Array [ ] `; -exports[`datasource/nuget getReleases processes real data (v3) feed is a nuget.org 1`] = ` +exports[`datasource/nuget/index getReleases processes real data (v3) feed is a nuget.org 1`] = ` Object { "homepage": "https://nunit.org/", "registryUrl": "https://api.nuget.org/v3/index.json", @@ -496,7 +496,7 @@ Object { } `; -exports[`datasource/nuget getReleases processes real data (v3) feed is a nuget.org 2`] = ` +exports[`datasource/nuget/index getReleases processes real data (v3) feed is a nuget.org 2`] = ` Array [ Object { "headers": Object { @@ -540,7 +540,7 @@ Array [ ] `; -exports[`datasource/nuget getReleases processes real data (v3) feed is not a nuget.org 1`] = ` +exports[`datasource/nuget/index getReleases processes real data (v3) feed is not a nuget.org 1`] = ` Object { "homepage": "https://nunit.org/", "registryUrl": "https://myprivatefeed/index.json", @@ -730,7 +730,7 @@ Object { } `; -exports[`datasource/nuget getReleases processes real data (v3) feed is not a nuget.org 2`] = ` +exports[`datasource/nuget/index getReleases processes real data (v3) feed is not a nuget.org 2`] = ` Array [ Object { "headers": Object { @@ -774,7 +774,7 @@ Array [ ] `; -exports[`datasource/nuget getReleases processes real data (v3) for several catalog pages 1`] = ` +exports[`datasource/nuget/index getReleases processes real data (v3) for several catalog pages 1`] = ` Object { "homepage": "https://nlog-project.org/", "registryUrl": "https://api.nuget.org/v3/index.json", @@ -1496,7 +1496,7 @@ Object { } `; -exports[`datasource/nuget getReleases processes real data (v3) for several catalog pages 2`] = ` +exports[`datasource/nuget/index getReleases processes real data (v3) for several catalog pages 2`] = ` Array [ Object { "headers": Object { @@ -1570,7 +1570,7 @@ Array [ ] `; -exports[`datasource/nuget getReleases processes real data no relase (v2) 1`] = ` +exports[`datasource/nuget/index getReleases processes real data no relase (v2) 1`] = ` Array [ Object { "headers": Object { @@ -1584,7 +1584,7 @@ Array [ ] `; -exports[`datasource/nuget getReleases processes real data with no github project url (v2) 1`] = ` +exports[`datasource/nuget/index getReleases processes real data with no github project url (v2) 1`] = ` Object { "registryUrl": "https://www.nuget.org/api/v2/", "releases": Array [ @@ -1596,7 +1596,7 @@ Object { } `; -exports[`datasource/nuget getReleases processes real data with no github project url (v2) 2`] = ` +exports[`datasource/nuget/index getReleases processes real data with no github project url (v2) 2`] = ` Array [ Object { "headers": Object { @@ -1610,7 +1610,7 @@ Array [ ] `; -exports[`datasource/nuget getReleases processes real data without project url (v2) 1`] = ` +exports[`datasource/nuget/index getReleases processes real data without project url (v2) 1`] = ` Object { "registryUrl": "https://www.nuget.org/api/v2/", "releases": Array [ @@ -1747,7 +1747,7 @@ Object { } `; -exports[`datasource/nuget getReleases processes real data without project url (v2) 2`] = ` +exports[`datasource/nuget/index getReleases processes real data without project url (v2) 2`] = ` Array [ Object { "headers": Object { @@ -1761,7 +1761,7 @@ Array [ ] `; -exports[`datasource/nuget getReleases returns deduplicated results 1`] = ` +exports[`datasource/nuget/index getReleases returns deduplicated results 1`] = ` Object { "homepage": "https://nunit.org/", "releases": Array [ @@ -1996,7 +1996,7 @@ Object { } `; -exports[`datasource/nuget getReleases returns deduplicated results 2`] = ` +exports[`datasource/nuget/index getReleases returns deduplicated results 2`] = ` Array [ Object { "headers": Object { @@ -2079,7 +2079,7 @@ Array [ ] `; -exports[`datasource/nuget getReleases returns null for empty result (v2) 1`] = ` +exports[`datasource/nuget/index getReleases returns null for empty result (v2) 1`] = ` Array [ Object { "headers": Object { @@ -2093,7 +2093,7 @@ Array [ ] `; -exports[`datasource/nuget getReleases returns null for empty result (v3) 1`] = ` +exports[`datasource/nuget/index getReleases returns null for empty result (v3) 1`] = ` Array [ Object { "headers": Object { @@ -2108,7 +2108,7 @@ Array [ ] `; -exports[`datasource/nuget getReleases returns null for empty result (v3v2) 1`] = ` +exports[`datasource/nuget/index getReleases returns null for empty result (v3v2) 1`] = ` Array [ Object { "headers": Object { @@ -2132,7 +2132,7 @@ Array [ ] `; -exports[`datasource/nuget getReleases returns null for non 200 (v2) 1`] = ` +exports[`datasource/nuget/index getReleases returns null for non 200 (v2) 1`] = ` Array [ Object { "headers": Object { @@ -2146,7 +2146,7 @@ Array [ ] `; -exports[`datasource/nuget getReleases returns null for non 200 (v3) 1`] = ` +exports[`datasource/nuget/index getReleases returns null for non 200 (v3) 1`] = ` Array [ Object { "headers": Object { @@ -2161,7 +2161,7 @@ Array [ ] `; -exports[`datasource/nuget getReleases returns null for non 200 (v3v2) 1`] = ` +exports[`datasource/nuget/index getReleases returns null for non 200 (v3v2) 1`] = ` Array [ Object { "headers": Object { @@ -2185,7 +2185,7 @@ Array [ ] `; -exports[`datasource/nuget getReleases returns null for unknown error (v2) 1`] = ` +exports[`datasource/nuget/index getReleases returns null for unknown error (v2) 1`] = ` Array [ Object { "headers": Object { @@ -2199,7 +2199,7 @@ Array [ ] `; -exports[`datasource/nuget getReleases returns null for unknown error (v3v2) 1`] = ` +exports[`datasource/nuget/index getReleases returns null for unknown error (v3v2) 1`] = ` Array [ Object { "headers": Object { @@ -2223,7 +2223,7 @@ Array [ ] `; -exports[`datasource/nuget getReleases returns null for unknown error in getQueryUrlForV3Feed (v3) 1`] = ` +exports[`datasource/nuget/index getReleases returns null for unknown error in getQueryUrlForV3Feed (v3) 1`] = ` Array [ Object { "headers": Object { @@ -2248,7 +2248,7 @@ Array [ ] `; -exports[`datasource/nuget getReleases returns null for unknown error in getReleasesFromV3Feed (v3) 1`] = ` +exports[`datasource/nuget/index getReleases returns null for unknown error in getReleasesFromV3Feed (v3) 1`] = ` Array [ Object { "headers": Object { diff --git a/lib/datasource/nuget/index.spec.ts b/lib/datasource/nuget/index.spec.ts index 3170f4c73c0ea7..c8ecb5a1da68d8 100644 --- a/lib/datasource/nuget/index.spec.ts +++ b/lib/datasource/nuget/index.spec.ts @@ -1,6 +1,7 @@ import fs from 'fs'; import { getPkgReleases } from '..'; import * as httpMock from '../../../test/http-mock'; +import { getName } from '../../../test/util'; import * as _hostRules from '../../util/host-rules'; import { id as versioning } from '../../versioning/nuget'; import { id as datasource, parseRegistryUrl } from '.'; @@ -128,7 +129,7 @@ const configV3Multiple = { ], }; -describe('datasource/nuget', () => { +describe(getName(__filename), () => { describe('parseRegistryUrl', () => { beforeEach(() => { jest.resetAllMocks(); diff --git a/lib/datasource/orb/__snapshots__/index.spec.ts.snap b/lib/datasource/orb/__snapshots__/index.spec.ts.snap index f067c72d363f82..127ec2c18cab2d 100644 --- a/lib/datasource/orb/__snapshots__/index.spec.ts.snap +++ b/lib/datasource/orb/__snapshots__/index.spec.ts.snap @@ -1,6 +1,6 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP -exports[`datasource/orb getReleases processes homeUrl 1`] = ` +exports[`datasource/orb/index getReleases processes homeUrl 1`] = ` Object { "homepage": "https://google.com", "registryUrl": "https://circleci.com/", @@ -49,7 +49,7 @@ Object { } `; -exports[`datasource/orb getReleases processes homeUrl 2`] = ` +exports[`datasource/orb/index getReleases processes homeUrl 2`] = ` Array [ Object { "graphql": Object { @@ -81,7 +81,7 @@ Array [ ] `; -exports[`datasource/orb getReleases processes real data 1`] = ` +exports[`datasource/orb/index getReleases processes real data 1`] = ` Object { "homepage": "https://circleci.com/developer/orbs/orb/hyper-expanse/library-release-workflows", "registryUrl": "https://circleci.com/", @@ -130,7 +130,7 @@ Object { } `; -exports[`datasource/orb getReleases processes real data 2`] = ` +exports[`datasource/orb/index getReleases processes real data 2`] = ` Array [ Object { "graphql": Object { @@ -162,7 +162,7 @@ Array [ ] `; -exports[`datasource/orb getReleases returns null for 404 1`] = ` +exports[`datasource/orb/index getReleases returns null for 404 1`] = ` Array [ Object { "graphql": Object { @@ -194,7 +194,7 @@ Array [ ] `; -exports[`datasource/orb getReleases returns null for empty result 1`] = ` +exports[`datasource/orb/index getReleases returns null for empty result 1`] = ` Array [ Object { "graphql": Object { @@ -226,7 +226,7 @@ Array [ ] `; -exports[`datasource/orb getReleases returns null for missing orb 1`] = ` +exports[`datasource/orb/index getReleases returns null for missing orb 1`] = ` Array [ Object { "graphql": Object { @@ -258,7 +258,7 @@ Array [ ] `; -exports[`datasource/orb getReleases returns null for unknown error 1`] = ` +exports[`datasource/orb/index getReleases returns null for unknown error 1`] = ` Array [ Object { "graphql": Object { diff --git a/lib/datasource/orb/index.spec.ts b/lib/datasource/orb/index.spec.ts index 83c6b6faba8ae1..6162d340ab7aaa 100644 --- a/lib/datasource/orb/index.spec.ts +++ b/lib/datasource/orb/index.spec.ts @@ -1,5 +1,6 @@ import { getPkgReleases } from '..'; import * as httpMock from '../../../test/http-mock'; +import { getName } from '../../../test/util'; import { id as datasource } from '.'; const orbData = { @@ -25,7 +26,7 @@ const orbData = { const baseUrl = 'https://circleci.com'; -describe('datasource/orb', () => { +describe(getName(__filename), () => { describe('getReleases', () => { beforeEach(() => { jest.clearAllMocks(); diff --git a/lib/datasource/packagist/__snapshots__/index.spec.ts.snap b/lib/datasource/packagist/__snapshots__/index.spec.ts.snap index 81471e42b6535c..656ba9df8d7a9e 100644 --- a/lib/datasource/packagist/__snapshots__/index.spec.ts.snap +++ b/lib/datasource/packagist/__snapshots__/index.spec.ts.snap @@ -1,6 +1,6 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP -exports[`datasource/packagist getReleases adds packagist source implicitly 1`] = ` +exports[`datasource/packagist/index getReleases adds packagist source implicitly 1`] = ` Object { "registryUrl": "https://packagist.org", "releases": Array [ @@ -84,7 +84,7 @@ Object { } `; -exports[`datasource/packagist getReleases adds packagist source implicitly 2`] = ` +exports[`datasource/packagist/index getReleases adds packagist source implicitly 2`] = ` Array [ Object { "headers": Object { @@ -99,7 +99,7 @@ Array [ ] `; -exports[`datasource/packagist getReleases handles auth rejections 1`] = ` +exports[`datasource/packagist/index getReleases handles auth rejections 1`] = ` Array [ Object { "headers": Object { @@ -124,7 +124,7 @@ Array [ ] `; -exports[`datasource/packagist getReleases handles not found registries 1`] = ` +exports[`datasource/packagist/index getReleases handles not found registries 1`] = ` Array [ Object { "headers": Object { @@ -149,7 +149,7 @@ Array [ ] `; -exports[`datasource/packagist getReleases handles provider-includes miss 1`] = ` +exports[`datasource/packagist/index getReleases handles provider-includes miss 1`] = ` Array [ Object { "headers": Object { @@ -184,7 +184,7 @@ Array [ ] `; -exports[`datasource/packagist getReleases handles providers miss 1`] = ` +exports[`datasource/packagist/index getReleases handles providers miss 1`] = ` Array [ Object { "headers": Object { @@ -209,7 +209,7 @@ Array [ ] `; -exports[`datasource/packagist getReleases handles timeouts 1`] = ` +exports[`datasource/packagist/index getReleases handles timeouts 1`] = ` Array [ Object { "headers": Object { @@ -234,7 +234,7 @@ Array [ ] `; -exports[`datasource/packagist getReleases processes real versioned data 1`] = ` +exports[`datasource/packagist/index getReleases processes real versioned data 1`] = ` Object { "registryUrl": "https://packagist.org", "releases": Array [ @@ -318,7 +318,7 @@ Object { } `; -exports[`datasource/packagist getReleases processes real versioned data 2`] = ` +exports[`datasource/packagist/index getReleases processes real versioned data 2`] = ` Array [ Object { "headers": Object { @@ -333,7 +333,7 @@ Array [ ] `; -exports[`datasource/packagist getReleases supports includes packages 1`] = ` +exports[`datasource/packagist/index getReleases supports includes packages 1`] = ` Object { "homepage": "http://guzzlephp.org/", "registryUrl": "https://composer.renovatebot.com", @@ -478,7 +478,7 @@ Object { } `; -exports[`datasource/packagist getReleases supports includes packages 2`] = ` +exports[`datasource/packagist/index getReleases supports includes packages 2`] = ` Array [ Object { "headers": Object { @@ -505,7 +505,7 @@ Array [ ] `; -exports[`datasource/packagist getReleases supports lazy repositories 1`] = ` +exports[`datasource/packagist/index getReleases supports lazy repositories 1`] = ` Object { "registryUrl": "https://composer.renovatebot.com/composer/lazy", "releases": Array [ @@ -521,7 +521,7 @@ Object { } `; -exports[`datasource/packagist getReleases supports lazy repositories 2`] = ` +exports[`datasource/packagist/index getReleases supports lazy repositories 2`] = ` Array [ Object { "headers": Object { @@ -546,7 +546,7 @@ Array [ ] `; -exports[`datasource/packagist getReleases supports plain packages 1`] = ` +exports[`datasource/packagist/index getReleases supports plain packages 1`] = ` Object { "registryUrl": "https://composer.renovatebot.com", "releases": Array [ @@ -566,7 +566,7 @@ Object { } `; -exports[`datasource/packagist getReleases supports plain packages 2`] = ` +exports[`datasource/packagist/index getReleases supports plain packages 2`] = ` Array [ Object { "headers": Object { @@ -581,7 +581,7 @@ Array [ ] `; -exports[`datasource/packagist getReleases supports provider-includes 1`] = ` +exports[`datasource/packagist/index getReleases supports provider-includes 1`] = ` Object { "homepage": "https://wordpress.org/plugins/1beyt/", "registryUrl": "https://composer.renovatebot.com", @@ -611,7 +611,7 @@ Object { } `; -exports[`datasource/packagist getReleases supports provider-includes 2`] = ` +exports[`datasource/packagist/index getReleases supports provider-includes 2`] = ` Array [ Object { "headers": Object { @@ -646,7 +646,7 @@ Array [ ] `; -exports[`datasource/packagist getReleases supports providers 1`] = ` +exports[`datasource/packagist/index getReleases supports providers 1`] = ` Object { "homepage": "https://wordpress.org/plugins/1beyt/", "registryUrl": "https://composer.renovatebot.com", @@ -676,7 +676,7 @@ Object { } `; -exports[`datasource/packagist getReleases supports providers 2`] = ` +exports[`datasource/packagist/index getReleases supports providers 2`] = ` Array [ Object { "headers": Object { diff --git a/lib/datasource/packagist/index.spec.ts b/lib/datasource/packagist/index.spec.ts index adf7b95abdc192..33132089277815 100644 --- a/lib/datasource/packagist/index.spec.ts +++ b/lib/datasource/packagist/index.spec.ts @@ -1,6 +1,7 @@ import fs from 'fs'; import { getPkgReleases } from '..'; import * as httpMock from '../../../test/http-mock'; +import { getName } from '../../../test/util'; import * as _hostRules from '../../util/host-rules'; import * as composerVersioning from '../../versioning/composer'; import { id as versioning } from '../../versioning/loose'; @@ -22,7 +23,7 @@ const mailchimpJson: any = fs.readFileSync( const baseUrl = 'https://packagist.org'; -describe('datasource/packagist', () => { +describe(getName(__filename), () => { describe('getReleases', () => { let config: any; beforeEach(() => { diff --git a/lib/datasource/pod/__snapshots__/index.spec.ts.snap b/lib/datasource/pod/__snapshots__/index.spec.ts.snap index 21f8c797b8c6c5..49a787fedebd8a 100644 --- a/lib/datasource/pod/__snapshots__/index.spec.ts.snap +++ b/lib/datasource/pod/__snapshots__/index.spec.ts.snap @@ -1,6 +1,6 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP -exports[`datasource/cocoapods getReleases processes real data from CDN 1`] = ` +exports[`datasource/pod/index getReleases processes real data from CDN 1`] = ` Array [ Object { "headers": Object { @@ -14,7 +14,7 @@ Array [ ] `; -exports[`datasource/cocoapods getReleases processes real data from Github 1`] = ` +exports[`datasource/pod/index getReleases processes real data from Github 1`] = ` Array [ Object { "headers": Object { @@ -39,7 +39,7 @@ Array [ ] `; -exports[`datasource/cocoapods getReleases returns null for 401 1`] = ` +exports[`datasource/pod/index getReleases returns null for 401 1`] = ` Array [ Object { "headers": Object { @@ -53,7 +53,7 @@ Array [ ] `; -exports[`datasource/cocoapods getReleases returns null for 404 1`] = ` +exports[`datasource/pod/index getReleases returns null for 404 1`] = ` Array [ Object { "headers": Object { @@ -78,7 +78,7 @@ Array [ ] `; -exports[`datasource/cocoapods getReleases returns null for unknown error 1`] = ` +exports[`datasource/pod/index getReleases returns null for unknown error 1`] = ` Array [ Object { "headers": Object { @@ -92,7 +92,7 @@ Array [ ] `; -exports[`datasource/cocoapods getReleases throws for 429 1`] = ` +exports[`datasource/pod/index getReleases throws for 429 1`] = ` Array [ Object { "headers": Object { diff --git a/lib/datasource/pod/index.spec.ts b/lib/datasource/pod/index.spec.ts index 4fc7e8c8823791..f803877caa9a7b 100644 --- a/lib/datasource/pod/index.spec.ts +++ b/lib/datasource/pod/index.spec.ts @@ -1,5 +1,6 @@ import { getPkgReleases } from '..'; import * as httpMock from '../../../test/http-mock'; +import { getName } from '../../../test/util'; import { EXTERNAL_HOST_ERROR } from '../../constants/error-messages'; import * as rubyVersioning from '../../versioning/ruby'; import * as pod from '.'; @@ -14,7 +15,7 @@ const config = { const githubApiHost = 'https://api.github.com'; const cocoapodsHost = 'https://cdn.cocoapods.org'; -describe('datasource/cocoapods', () => { +describe(getName(__filename), () => { describe('getReleases', () => { beforeEach(() => { jest.resetAllMocks(); diff --git a/lib/datasource/pypi/__snapshots__/index.spec.ts.snap b/lib/datasource/pypi/__snapshots__/index.spec.ts.snap index f4e233a9503b4d..794a2a2421d0a4 100644 --- a/lib/datasource/pypi/__snapshots__/index.spec.ts.snap +++ b/lib/datasource/pypi/__snapshots__/index.spec.ts.snap @@ -1,6 +1,6 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP -exports[`datasource/pypi getReleases fall back from json and process data from simple endpoint 1`] = ` +exports[`datasource/pypi/index getReleases fall back from json and process data from simple endpoint 1`] = ` Object { "registryUrl": "https://custom.pypi.net/foo", "releases": Array [ @@ -42,7 +42,7 @@ Object { } `; -exports[`datasource/pypi getReleases fall back from json and process data from simple endpoint 2`] = ` +exports[`datasource/pypi/index getReleases fall back from json and process data from simple endpoint 2`] = ` Array [ Object { "headers": Object { @@ -66,7 +66,7 @@ Array [ ] `; -exports[`datasource/pypi getReleases find url from project_urls 1`] = ` +exports[`datasource/pypi/index getReleases find url from project_urls 1`] = ` Array [ Object { "headers": Object { @@ -81,7 +81,7 @@ Array [ ] `; -exports[`datasource/pypi getReleases parses data-requires-python and respects constraints from simple endpoint 1`] = ` +exports[`datasource/pypi/index getReleases parses data-requires-python and respects constraints from simple endpoint 1`] = ` Object { "registryUrl": "https://pypi.org/simple/", "releases": Array [ @@ -107,7 +107,7 @@ Object { } `; -exports[`datasource/pypi getReleases parses data-requires-python and respects constraints from simple endpoint 2`] = ` +exports[`datasource/pypi/index getReleases parses data-requires-python and respects constraints from simple endpoint 2`] = ` Array [ Object { "headers": Object { @@ -121,7 +121,7 @@ Array [ ] `; -exports[`datasource/pypi getReleases process data from +simple endpoint 1`] = ` +exports[`datasource/pypi/index getReleases process data from +simple endpoint 1`] = ` Object { "registryUrl": "https://some.registry.org/+simple/", "releases": Array [ @@ -163,7 +163,7 @@ Object { } `; -exports[`datasource/pypi getReleases process data from +simple endpoint 2`] = ` +exports[`datasource/pypi/index getReleases process data from +simple endpoint 2`] = ` Array [ Object { "headers": Object { @@ -177,7 +177,7 @@ Array [ ] `; -exports[`datasource/pypi getReleases process data from simple endpoint 1`] = ` +exports[`datasource/pypi/index getReleases process data from simple endpoint 1`] = ` Object { "registryUrl": "https://pypi.org/simple/", "releases": Array [ @@ -219,7 +219,7 @@ Object { } `; -exports[`datasource/pypi getReleases process data from simple endpoint 2`] = ` +exports[`datasource/pypi/index getReleases process data from simple endpoint 2`] = ` Array [ Object { "headers": Object { @@ -233,7 +233,7 @@ Array [ ] `; -exports[`datasource/pypi getReleases process data from simple endpoint with hyphens replaced with underscores 1`] = ` +exports[`datasource/pypi/index getReleases process data from simple endpoint with hyphens replaced with underscores 1`] = ` Object { "registryUrl": "https://pypi.org/simple/", "releases": Array [ @@ -244,7 +244,7 @@ Object { } `; -exports[`datasource/pypi getReleases process data from simple endpoint with hyphens replaced with underscores 2`] = ` +exports[`datasource/pypi/index getReleases process data from simple endpoint with hyphens replaced with underscores 2`] = ` Array [ Object { "headers": Object { @@ -258,7 +258,7 @@ Array [ ] `; -exports[`datasource/pypi getReleases processes real data 1`] = ` +exports[`datasource/pypi/index getReleases processes real data 1`] = ` Object { "registryUrl": "https://pypi.org/pypi/", "releases": Array [ @@ -356,7 +356,7 @@ Object { } `; -exports[`datasource/pypi getReleases processes real data 2`] = ` +exports[`datasource/pypi/index getReleases processes real data 2`] = ` Array [ Object { "headers": Object { @@ -371,7 +371,7 @@ Array [ ] `; -exports[`datasource/pypi getReleases respects constraints 1`] = ` +exports[`datasource/pypi/index getReleases respects constraints 1`] = ` Object { "registryUrl": "https://pypi.org/pypi/", "releases": Array [ @@ -391,7 +391,7 @@ Object { } `; -exports[`datasource/pypi getReleases respects constraints 2`] = ` +exports[`datasource/pypi/index getReleases respects constraints 2`] = ` Array [ Object { "headers": Object { @@ -406,9 +406,9 @@ Array [ ] `; -exports[`datasource/pypi getReleases returns non-github home_page 1`] = `"https://microsoft.com"`; +exports[`datasource/pypi/index getReleases returns non-github home_page 1`] = `"https://microsoft.com"`; -exports[`datasource/pypi getReleases returns non-github home_page 2`] = ` +exports[`datasource/pypi/index getReleases returns non-github home_page 2`] = ` Array [ Object { "headers": Object { @@ -423,7 +423,7 @@ Array [ ] `; -exports[`datasource/pypi getReleases returns null for 404 1`] = ` +exports[`datasource/pypi/index getReleases returns null for 404 1`] = ` Array [ Object { "headers": Object { @@ -447,7 +447,7 @@ Array [ ] `; -exports[`datasource/pypi getReleases returns null for 404 response from simple endpoint 1`] = ` +exports[`datasource/pypi/index getReleases returns null for 404 response from simple endpoint 1`] = ` Array [ Object { "headers": Object { @@ -461,7 +461,7 @@ Array [ ] `; -exports[`datasource/pypi getReleases returns null for empty response 1`] = ` +exports[`datasource/pypi/index getReleases returns null for empty response 1`] = ` Array [ Object { "headers": Object { @@ -475,7 +475,7 @@ Array [ ] `; -exports[`datasource/pypi getReleases returns null for empty result 1`] = ` +exports[`datasource/pypi/index getReleases returns null for empty result 1`] = ` Array [ Object { "headers": Object { @@ -490,7 +490,7 @@ Array [ ] `; -exports[`datasource/pypi getReleases returns null if mismatched name 1`] = ` +exports[`datasource/pypi/index getReleases returns null if mismatched name 1`] = ` Array [ Object { "headers": Object { @@ -505,7 +505,7 @@ Array [ ] `; -exports[`datasource/pypi getReleases supports custom datasource url 1`] = ` +exports[`datasource/pypi/index getReleases supports custom datasource url 1`] = ` Array [ Object { "headers": Object { @@ -520,7 +520,7 @@ Array [ ] `; -exports[`datasource/pypi getReleases supports multiple custom datasource urls 1`] = ` +exports[`datasource/pypi/index getReleases supports multiple custom datasource urls 1`] = ` Array [ Object { "headers": Object { diff --git a/lib/datasource/pypi/index.spec.ts b/lib/datasource/pypi/index.spec.ts index 42588b4e32e5ff..75c8c8efcc6b43 100644 --- a/lib/datasource/pypi/index.spec.ts +++ b/lib/datasource/pypi/index.spec.ts @@ -1,6 +1,7 @@ import fs from 'fs'; import { getPkgReleases } from '..'; import * as httpMock from '../../../test/http-mock'; +import { getName } from '../../../test/util'; import * as hostRules from '../../util/host-rules'; import { id as datasource } from '.'; @@ -25,7 +26,7 @@ const mixedHyphensResponse = fs.readFileSync( const baseUrl = 'https://pypi.org/pypi'; -describe('datasource/pypi', () => { +describe(getName(__filename), () => { describe('getReleases', () => { const OLD_ENV = process.env; diff --git a/lib/datasource/ruby-version/__snapshots__/index.spec.ts.snap b/lib/datasource/ruby-version/__snapshots__/index.spec.ts.snap index d02dee6c506c35..b69a7fb2e3d471 100644 --- a/lib/datasource/ruby-version/__snapshots__/index.spec.ts.snap +++ b/lib/datasource/ruby-version/__snapshots__/index.spec.ts.snap @@ -1,6 +1,6 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP -exports[`datasource/gradle getReleases parses real data 1`] = ` +exports[`datasource/ruby-version/index getReleases parses real data 1`] = ` Object { "homepage": "https://www.ruby-lang.org", "registryUrl": "https://www.ruby-lang.org/", @@ -675,7 +675,7 @@ Object { } `; -exports[`datasource/gradle getReleases parses real data 2`] = ` +exports[`datasource/ruby-version/index getReleases parses real data 2`] = ` Array [ Object { "headers": Object { @@ -689,7 +689,7 @@ Array [ ] `; -exports[`datasource/gradle getReleases throws for 404 1`] = ` +exports[`datasource/ruby-version/index getReleases throws for 404 1`] = ` Array [ Object { "headers": Object { @@ -703,7 +703,7 @@ Array [ ] `; -exports[`datasource/gradle getReleases throws for empty result 1`] = ` +exports[`datasource/ruby-version/index getReleases throws for empty result 1`] = ` Array [ Object { "headers": Object { diff --git a/lib/datasource/ruby-version/index.spec.ts b/lib/datasource/ruby-version/index.spec.ts index 40283bd64e8965..759931897df364 100644 --- a/lib/datasource/ruby-version/index.spec.ts +++ b/lib/datasource/ruby-version/index.spec.ts @@ -1,6 +1,7 @@ import fs from 'fs'; import { getPkgReleases } from '..'; import * as httpMock from '../../../test/http-mock'; +import { getName } from '../../../test/util'; import { id as datasource } from '.'; const rubyReleasesHtml = fs.readFileSync( @@ -8,7 +9,7 @@ const rubyReleasesHtml = fs.readFileSync( 'utf8' ); -describe('datasource/gradle', () => { +describe(getName(__filename), () => { describe('getReleases', () => { beforeEach(() => { httpMock.setup(); diff --git a/lib/datasource/rubygems/__snapshots__/index.spec.ts.snap b/lib/datasource/rubygems/__snapshots__/index.spec.ts.snap index 51deba2f7debb0..6121d7da25e5bd 100644 --- a/lib/datasource/rubygems/__snapshots__/index.spec.ts.snap +++ b/lib/datasource/rubygems/__snapshots__/index.spec.ts.snap @@ -1,6 +1,6 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP -exports[`datasource/rubygems getReleases returns a dep for rubygems.org package hit 1`] = ` +exports[`datasource/rubygems/index getReleases returns a dep for rubygems.org package hit 1`] = ` Object { "registryUrl": "https://rubygems.org", "releases": Array [ @@ -14,7 +14,7 @@ Object { } `; -exports[`datasource/rubygems getReleases returns a dep for rubygems.org package hit 2`] = ` +exports[`datasource/rubygems/index getReleases returns a dep for rubygems.org package hit 2`] = ` Array [ Object { "headers": Object { @@ -29,7 +29,7 @@ Array [ ] `; -exports[`datasource/rubygems getReleases returns null for missing pkg 1`] = ` +exports[`datasource/rubygems/index getReleases returns null for missing pkg 1`] = ` Array [ Object { "headers": Object { @@ -56,7 +56,7 @@ Array [ ] `; -exports[`datasource/rubygems getReleases returns null for rubygems.org package miss 1`] = ` +exports[`datasource/rubygems/index getReleases returns null for rubygems.org package miss 1`] = ` Array [ Object { "headers": Object { @@ -71,7 +71,7 @@ Array [ ] `; -exports[`datasource/rubygems getReleases returns null if mismatched name 1`] = ` +exports[`datasource/rubygems/index getReleases returns null if mismatched name 1`] = ` Array [ Object { "headers": Object { @@ -98,7 +98,7 @@ Array [ ] `; -exports[`datasource/rubygems getReleases uses multiple source urls 1`] = ` +exports[`datasource/rubygems/index getReleases uses multiple source urls 1`] = ` Object { "homepage": "http://rubyonrails.org", "registryUrl": "https://firstparty.com/basepath/", @@ -2481,7 +2481,7 @@ Object { } `; -exports[`datasource/rubygems getReleases uses multiple source urls 2`] = ` +exports[`datasource/rubygems/index getReleases uses multiple source urls 2`] = ` Array [ Object { "headers": Object { @@ -2519,7 +2519,7 @@ Array [ ] `; -exports[`datasource/rubygems getReleases uses rubygems.org if no registry urls were provided 1`] = ` +exports[`datasource/rubygems/index getReleases uses rubygems.org if no registry urls were provided 1`] = ` Object { "registryUrl": "https://rubygems.org", "releases": Array [ @@ -2533,7 +2533,7 @@ Object { } `; -exports[`datasource/rubygems getReleases uses rubygems.org if no registry urls were provided 2`] = ` +exports[`datasource/rubygems/index getReleases uses rubygems.org if no registry urls were provided 2`] = ` Array [ Object { "headers": Object { @@ -2548,7 +2548,7 @@ Array [ ] `; -exports[`datasource/rubygems getReleases works with real data 1`] = ` +exports[`datasource/rubygems/index getReleases works with real data 1`] = ` Object { "homepage": "http://rubyonrails.org", "registryUrl": "https://thirdparty.com", @@ -4931,7 +4931,7 @@ Object { } `; -exports[`datasource/rubygems getReleases works with real data 2`] = ` +exports[`datasource/rubygems/index getReleases works with real data 2`] = ` Array [ Object { "headers": Object { diff --git a/lib/datasource/rubygems/index.spec.ts b/lib/datasource/rubygems/index.spec.ts index 21394308087e69..29c849d9f289c3 100644 --- a/lib/datasource/rubygems/index.spec.ts +++ b/lib/datasource/rubygems/index.spec.ts @@ -1,5 +1,6 @@ import { getPkgReleases } from '..'; import * as httpMock from '../../../test/http-mock'; +import { getName } from '../../../test/util'; import * as rubyVersioning from '../../versioning/ruby'; import railsInfo from './__fixtures__/rails/info.json'; import railsVersions from './__fixtures__/rails/versions.json'; @@ -25,7 +26,7 @@ const rubygemsOrgVersions = `created_at: 2017-03-27T04:38:13+00:00 1pass -0.1.2 abcdef 21-day-challenge-countdown 0.1.0,0.1.1,0.1.2 57e8873fe713063f4e54e85bbbd709bb`; -describe('datasource/rubygems', () => { +describe(getName(__filename), () => { describe('getReleases', () => { const SKIP_CACHE = process.env.RENOVATE_SKIP_CACHE; diff --git a/lib/datasource/sbt-package/__snapshots__/index.spec.ts.snap b/lib/datasource/sbt-package/__snapshots__/index.spec.ts.snap index 10bcead987b621..664abc69770054 100644 --- a/lib/datasource/sbt-package/__snapshots__/index.spec.ts.snap +++ b/lib/datasource/sbt-package/__snapshots__/index.spec.ts.snap @@ -1,6 +1,6 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP -exports[`datasource/sbt parses Maven index directory 1`] = ` +exports[`datasource/sbt-package/index parses Maven index directory 1`] = ` Array [ "autofix-3.0.6_2.11", "autofix-3.0.6_2.12", @@ -188,7 +188,7 @@ Array [ ] `; -exports[`datasource/sbt parses sbt index directory 1`] = ` +exports[`datasource/sbt-package/index parses sbt index directory 1`] = ` Array [ "au.com.onegeek", "bavadim", diff --git a/lib/datasource/sbt-package/index.spec.ts b/lib/datasource/sbt-package/index.spec.ts index 6e41472ca7d951..ba30b93ad56bfd 100644 --- a/lib/datasource/sbt-package/index.spec.ts +++ b/lib/datasource/sbt-package/index.spec.ts @@ -2,6 +2,7 @@ import fs from 'fs'; import nock from 'nock'; import upath from 'upath'; import { getPkgReleases } from '..'; +import { getName } from '../../../test/util'; import * as mavenVersioning from '../../versioning/maven'; import { MAVEN_REPO } from '../maven/common'; import { parseIndexDir } from '../sbt-plugin/util'; @@ -17,7 +18,7 @@ const sbtPluginIndex = fs.readFileSync( 'utf8' ); -describe('datasource/sbt', () => { +describe(getName(__filename), () => { it('parses Maven index directory', () => { expect(parseIndexDir(mavenIndexHtml)).toMatchSnapshot(); }); diff --git a/lib/datasource/sbt-plugin/__snapshots__/index.spec.ts.snap b/lib/datasource/sbt-plugin/__snapshots__/index.spec.ts.snap index 10bcead987b621..2a9c553ef6a7eb 100644 --- a/lib/datasource/sbt-plugin/__snapshots__/index.spec.ts.snap +++ b/lib/datasource/sbt-plugin/__snapshots__/index.spec.ts.snap @@ -1,6 +1,6 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP -exports[`datasource/sbt parses Maven index directory 1`] = ` +exports[`datasource/sbt-plugin/index parses Maven index directory 1`] = ` Array [ "autofix-3.0.6_2.11", "autofix-3.0.6_2.12", @@ -188,7 +188,7 @@ Array [ ] `; -exports[`datasource/sbt parses sbt index directory 1`] = ` +exports[`datasource/sbt-plugin/index parses sbt index directory 1`] = ` Array [ "au.com.onegeek", "bavadim", diff --git a/lib/datasource/sbt-plugin/index.spec.ts b/lib/datasource/sbt-plugin/index.spec.ts index 5c5bc67a6e01ff..ab8cd3e9f7cc07 100644 --- a/lib/datasource/sbt-plugin/index.spec.ts +++ b/lib/datasource/sbt-plugin/index.spec.ts @@ -2,6 +2,7 @@ import fs from 'fs'; import nock from 'nock'; import upath from 'upath'; import { getPkgReleases } from '..'; +import { getName } from '../../../test/util'; import * as mavenVersioning from '../../versioning/maven'; import { MAVEN_REPO } from '../maven/common'; import { parseIndexDir } from './util'; @@ -17,7 +18,7 @@ const sbtPluginIndex = fs.readFileSync( 'utf8' ); -describe('datasource/sbt', () => { +describe(getName(__filename), () => { it('parses Maven index directory', () => { expect(parseIndexDir(mavenIndexHtml)).toMatchSnapshot(); }); diff --git a/lib/datasource/terraform-module/__snapshots__/index.spec.ts.snap b/lib/datasource/terraform-module/__snapshots__/index.spec.ts.snap index a2ae6d191c0aad..ba9127ade469d2 100644 --- a/lib/datasource/terraform-module/__snapshots__/index.spec.ts.snap +++ b/lib/datasource/terraform-module/__snapshots__/index.spec.ts.snap @@ -1,6 +1,6 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP -exports[`datasource/terraform-module getReleases processes real data 1`] = ` +exports[`datasource/terraform-module/index getReleases processes real data 1`] = ` Object { "homepage": "https://registry.terraform.io/modules/hashicorp/consul/aws", "registryUrl": "https://registry.terraform.io", @@ -80,7 +80,7 @@ Object { } `; -exports[`datasource/terraform-module getReleases processes real data 2`] = ` +exports[`datasource/terraform-module/index getReleases processes real data 2`] = ` Array [ Object { "headers": Object { @@ -105,7 +105,7 @@ Array [ ] `; -exports[`datasource/terraform-module getReleases processes real data on changed subpath 1`] = ` +exports[`datasource/terraform-module/index getReleases processes real data on changed subpath 1`] = ` Array [ Object { "headers": Object { @@ -130,7 +130,7 @@ Array [ ] `; -exports[`datasource/terraform-module getReleases processes real data on changed subpath 2`] = ` +exports[`datasource/terraform-module/index getReleases processes real data on changed subpath 2`] = ` Object { "registryUrl": "https://terraform.foo.bar", "releases": Array [ @@ -209,7 +209,7 @@ Object { } `; -exports[`datasource/terraform-module getReleases processes with registry in name 1`] = ` +exports[`datasource/terraform-module/index getReleases processes with registry in name 1`] = ` Object { "homepage": "https://registry.terraform.io/modules/hashicorp/consul/aws", "registryUrl": "https://registry.terraform.io", @@ -289,7 +289,7 @@ Object { } `; -exports[`datasource/terraform-module getReleases processes with registry in name 2`] = ` +exports[`datasource/terraform-module/index getReleases processes with registry in name 2`] = ` Array [ Object { "headers": Object { @@ -314,7 +314,7 @@ Array [ ] `; -exports[`datasource/terraform-module getReleases rejects mismatch 1`] = ` +exports[`datasource/terraform-module/index getReleases rejects mismatch 1`] = ` Array [ Object { "headers": Object { @@ -339,7 +339,7 @@ Array [ ] `; -exports[`datasource/terraform-module getReleases rejects servicediscovery 1`] = ` +exports[`datasource/terraform-module/index getReleases rejects servicediscovery 1`] = ` Array [ Object { "headers": Object { @@ -354,7 +354,7 @@ Array [ ] `; -exports[`datasource/terraform-module getReleases returns null for 404 1`] = ` +exports[`datasource/terraform-module/index getReleases returns null for 404 1`] = ` Array [ Object { "headers": Object { @@ -379,7 +379,7 @@ Array [ ] `; -exports[`datasource/terraform-module getReleases returns null for empty result 1`] = ` +exports[`datasource/terraform-module/index getReleases returns null for empty result 1`] = ` Array [ Object { "headers": Object { @@ -404,7 +404,7 @@ Array [ ] `; -exports[`datasource/terraform-module getReleases returns null for unknown error 1`] = ` +exports[`datasource/terraform-module/index getReleases returns null for unknown error 1`] = ` Array [ Object { "headers": Object { diff --git a/lib/datasource/terraform-module/index.spec.ts b/lib/datasource/terraform-module/index.spec.ts index 51d6a8adf6f9b1..d7d1d0b7abac6d 100644 --- a/lib/datasource/terraform-module/index.spec.ts +++ b/lib/datasource/terraform-module/index.spec.ts @@ -1,6 +1,7 @@ import fs from 'fs'; import { getPkgReleases } from '..'; import * as httpMock from '../../../test/http-mock'; +import { getName } from '../../../test/util'; import { id as datasource } from '.'; const consulData: any = fs.readFileSync( @@ -16,7 +17,7 @@ const serviceDiscoveryCustomResult: any = fs.readFileSync( const baseUrl = 'https://registry.terraform.io'; const localTerraformEnterprisebaseUrl = 'https://terraform.foo.bar'; -describe('datasource/terraform-module', () => { +describe(getName(__filename), () => { describe('getReleases', () => { beforeEach(() => { jest.clearAllMocks(); diff --git a/lib/datasource/terraform-provider/__snapshots__/index.spec.ts.snap b/lib/datasource/terraform-provider/__snapshots__/index.spec.ts.snap index b7c46793087d19..ba9a88d4094223 100644 --- a/lib/datasource/terraform-provider/__snapshots__/index.spec.ts.snap +++ b/lib/datasource/terraform-provider/__snapshots__/index.spec.ts.snap @@ -1,6 +1,6 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP -exports[`datasource/terraform getReleases processes data with alternative backend 1`] = ` +exports[`datasource/terraform-provider/index getReleases processes data with alternative backend 1`] = ` Object { "registryUrl": "https://releases.hashicorp.com", "releases": Array [ @@ -18,7 +18,7 @@ Object { } `; -exports[`datasource/terraform getReleases processes data with alternative backend 2`] = ` +exports[`datasource/terraform-provider/index getReleases processes data with alternative backend 2`] = ` Array [ Object { "headers": Object { @@ -53,7 +53,7 @@ Array [ ] `; -exports[`datasource/terraform getReleases processes real data 1`] = ` +exports[`datasource/terraform-provider/index getReleases processes real data 1`] = ` Object { "homepage": "https://registry.terraform.io/providers/hashicorp/azurerm", "registryUrl": "https://registry.terraform.io", @@ -259,7 +259,7 @@ Object { } `; -exports[`datasource/terraform getReleases processes real data 2`] = ` +exports[`datasource/terraform-provider/index getReleases processes real data 2`] = ` Array [ Object { "headers": Object { @@ -284,7 +284,7 @@ Array [ ] `; -exports[`datasource/terraform getReleases processes real data from lookupName 1`] = ` +exports[`datasource/terraform-provider/index getReleases processes real data from lookupName 1`] = ` Object { "homepage": "https://registry.company.com/providers/hashicorp/azurerm", "registryUrl": "https://registry.company.com", @@ -490,7 +490,7 @@ Object { } `; -exports[`datasource/terraform getReleases processes real data from lookupName 2`] = ` +exports[`datasource/terraform-provider/index getReleases processes real data from lookupName 2`] = ` Array [ Object { "headers": Object { @@ -515,7 +515,7 @@ Array [ ] `; -exports[`datasource/terraform getReleases returns null for 404 1`] = ` +exports[`datasource/terraform-provider/index getReleases returns null for 404 1`] = ` Array [ Object { "headers": Object { @@ -550,7 +550,7 @@ Array [ ] `; -exports[`datasource/terraform getReleases returns null for empty result 1`] = ` +exports[`datasource/terraform-provider/index getReleases returns null for empty result 1`] = ` Array [ Object { "headers": Object { @@ -585,7 +585,7 @@ Array [ ] `; -exports[`datasource/terraform getReleases returns null for error in service discovery 1`] = ` +exports[`datasource/terraform-provider/index getReleases returns null for error in service discovery 1`] = ` Array [ Object { "headers": Object { @@ -610,7 +610,7 @@ Array [ ] `; -exports[`datasource/terraform getReleases returns null for unknown error 1`] = ` +exports[`datasource/terraform-provider/index getReleases returns null for unknown error 1`] = ` Array [ Object { "headers": Object { @@ -645,4 +645,4 @@ Array [ ] `; -exports[`datasource/terraform getReleases simulate failing secondary release source 1`] = `null`; +exports[`datasource/terraform-provider/index getReleases simulate failing secondary release source 1`] = `null`; diff --git a/lib/datasource/terraform-provider/index.spec.ts b/lib/datasource/terraform-provider/index.spec.ts index 126ddedfc07233..c7725e2c744573 100644 --- a/lib/datasource/terraform-provider/index.spec.ts +++ b/lib/datasource/terraform-provider/index.spec.ts @@ -1,6 +1,7 @@ import fs from 'fs'; import { getPkgReleases } from '..'; import * as httpMock from '../../../test/http-mock'; +import { getName } from '../../../test/util'; import { id as datasource, defaultRegistryUrls } from '.'; const consulData: any = fs.readFileSync( @@ -16,7 +17,7 @@ const serviceDiscoveryResult: any = fs.readFileSync( const primaryUrl = defaultRegistryUrls[0]; const secondaryUrl = defaultRegistryUrls[1]; -describe('datasource/terraform', () => { +describe(getName(__filename), () => { describe('getReleases', () => { beforeEach(() => { jest.clearAllMocks();