Skip to content

Commit

Permalink
Merge branch 'main' into implement-terraform-lock-files
Browse files Browse the repository at this point in the history
  • Loading branch information
secustor authored Apr 26, 2021
2 parents 0086e6d + fb50312 commit 0f50ae2
Show file tree
Hide file tree
Showing 280 changed files with 589 additions and 673 deletions.
2 changes: 1 addition & 1 deletion lib/config/cli.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import * as cli from './cli';
import getArgv from './config/__fixtures__/argv';
import type { RenovateOptions } from './types';

describe(getName(__filename), () => {
describe(getName(), () => {
let argv: string[];
beforeEach(() => {
argv = getArgv();
Expand Down
4 changes: 2 additions & 2 deletions lib/config/decrypt.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@ import { setAdminConfig } from './admin';
import { decryptConfig } from './decrypt';
import type { RenovateConfig } from './types';

const privateKey = loadFixture(__filename, 'private.pem', 'keys');
const privateKey = loadFixture('private.pem', 'keys');

describe(getName(__filename), () => {
describe(getName(), () => {
describe('decryptConfig()', () => {
let config: RenovateConfig;
beforeEach(() => {
Expand Down
2 changes: 1 addition & 1 deletion lib/config/definitions.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ jest.mock('../manager', () => ({
getManagers: jest.fn(() => new Map().set('testManager', {})),
}));

describe(getName(__filename), () => {
describe(getName(), () => {
it('test manager should have no defaultConfig', () => {
const opts = getOptions();
expect(opts.filter((o) => o.name === 'testManager')).toEqual([]);
Expand Down
2 changes: 1 addition & 1 deletion lib/config/env.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import {
import * as env from './env';
import type { RenovateOptions } from './types';

describe(getName(__filename), () => {
describe(getName(), () => {
describe('.getConfig(env)', () => {
it('returns empty env', () => {
expect(env.getConfig({})).toEqual({ hostRules: [] });
Expand Down
2 changes: 1 addition & 1 deletion lib/config/file.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { getName } from '../../test/util';
import customConfig from './config/__fixtures__/file';
import * as file from './file';

describe(getName(__filename), () => {
describe(getName(), () => {
let tmp: DirectoryResult;

beforeAll(async () => {
Expand Down
2 changes: 1 addition & 1 deletion lib/config/index.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ try {

const defaultConfig = getConfig();

describe(getName(__filename), () => {
describe(getName(), () => {
describe('.parseConfigs(env, defaultArgv)', () => {
let configParser: typeof import('.');
let defaultArgv: string[];
Expand Down
2 changes: 1 addition & 1 deletion lib/config/massage.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { getName } from '../../test/util';
import * as massage from './massage';
import type { RenovateConfig } from './types';

describe(getName(__filename), () => {
describe(getName(), () => {
describe('massageConfig', () => {
it('returns empty', () => {
const config: RenovateConfig = {};
Expand Down
2 changes: 1 addition & 1 deletion lib/config/migrate-validate.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ beforeEach(() => {
config = getConfig();
});

describe(getName(__filename), () => {
describe(getName(), () => {
describe('migrateAndValidate()', () => {
it('handles empty', async () => {
const res = await migrateAndValidate(config, {});
Expand Down
2 changes: 1 addition & 1 deletion lib/config/migration.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ interface RenovateConfig extends _RenovateConfig {
node?: RenovateSharedConfig & { supportPolicy?: unknown };
}

describe(getName(__filename), () => {
describe(getName(), () => {
describe('migrateConfig(config, parentConfig)', () => {
it('migrates config', () => {
const config: RenovateConfig = {
Expand Down
2 changes: 1 addition & 1 deletion lib/config/presets/azure/index.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ jest.mock('../../../platform/azure/azure-got-wrapper');

const azureApi = mocked(_azureApi);

describe(getName(__filename), () => {
describe(getName(), () => {
beforeAll(() => {
setPlatformApi('azure');
});
Expand Down
2 changes: 1 addition & 1 deletion lib/config/presets/bitbucket-server/index.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ const hostRules = mocked(_hostRules);
const bitbucketApiHost = 'https://git.company.org';
const basePath = '/rest/api/1.0/projects/some/repos/repo/browse';

describe(getName(__filename), () => {
describe(getName(), () => {
beforeEach(() => {
httpMock.setup();
hostRules.find.mockReturnValue({ token: 'abc' });
Expand Down
2 changes: 1 addition & 1 deletion lib/config/presets/bitbucket/index.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ jest.unmock('../../../platform');
const baseUrl = 'https://api.bitbucket.org';
const basePath = '/2.0/repositories/some/repo/src/HEAD';

describe(getName(__filename), () => {
describe(getName(), () => {
beforeAll(() => {
setPlatformApi('bitbucket');
});
Expand Down
2 changes: 1 addition & 1 deletion lib/config/presets/gitea/index.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ const hostRules = mocked(_hostRules);
const giteaApiHost = gitea.Endpoint;
const basePath = '/repos/some/repo/contents';

describe(getName(__filename), () => {
describe(getName(), () => {
beforeEach(() => {
httpMock.setup();
hostRules.find.mockReturnValue({ token: 'abc' });
Expand Down
2 changes: 1 addition & 1 deletion lib/config/presets/github/index.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ const hostRules = mocked(_hostRules);
const githubApiHost = github.Endpoint;
const basePath = '/repos/some/repo/contents';

describe(getName(__filename), () => {
describe(getName(), () => {
beforeEach(() => {
httpMock.setup();
hostRules.find.mockReturnValue({ token: 'abc' });
Expand Down
2 changes: 1 addition & 1 deletion lib/config/presets/gitlab/index.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import * as gitlab from '.';
const gitlabApiHost = 'https://gitlab.com';
const basePath = '/api/v4/projects/some%2Frepo/repository';

describe(getName(__filename), () => {
describe(getName(), () => {
beforeEach(() => {
jest.resetAllMocks();
httpMock.setup();
Expand Down
7 changes: 2 additions & 5 deletions lib/config/presets/index.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,7 @@ jest.mock('./local');
const npm = mocked(_npm);
const local = mocked(_local);

const presetIkatyang = loadJsonFixture(
__filename,
'renovate-config-ikatyang.json'
);
const presetIkatyang = loadJsonFixture('renovate-config-ikatyang.json');

npm.getPreset = jest.fn(({ packageName, presetName }) => {
if (packageName === 'renovate-config-ikatyang') {
Expand All @@ -42,7 +39,7 @@ npm.getPreset = jest.fn(({ packageName, presetName }) => {
return null;
});

describe(getName(__filename), () => {
describe(getName(), () => {
describe('resolvePreset', () => {
let config: RenovateConfig;
beforeEach(() => {
Expand Down
2 changes: 1 addition & 1 deletion lib/config/presets/internal/index.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ npm.getPreset = jest.fn((_) => null);

const ignoredPresets = ['default:group', 'default:timezone'];

describe(getName(__filename), () => {
describe(getName(), () => {
it('fails for undefined internal preset', async () => {
const preset = 'foo:bar';
const presetConfig = { extends: [preset] };
Expand Down
2 changes: 1 addition & 1 deletion lib/config/presets/local/index.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ const gitea = mocked(_gitea);
const github = mocked(_github);
const gitlab = mocked(_gitlab);

describe(getName(__filename), () => {
describe(getName(), () => {
beforeEach(() => {
jest.resetAllMocks();
const preset = { resolved: 'preset' };
Expand Down
2 changes: 1 addition & 1 deletion lib/config/presets/npm/index.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import * as npm from '.';
jest.mock('registry-auth-token');
jest.mock('delay');

describe(getName(__filename), () => {
describe(getName(), () => {
beforeEach(() => {
jest.resetAllMocks();
setAdminConfig();
Expand Down
2 changes: 1 addition & 1 deletion lib/config/presets/util.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ const config: FetchPresetConfig = {

const fetch = jest.fn(() => Promise.resolve<Preset>({}));

describe(getName(__filename), () => {
describe(getName(), () => {
beforeEach(() => {
fetch.mockReset();
});
Expand Down
2 changes: 1 addition & 1 deletion lib/config/secrets.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import {
} from '../constants/error-messages';
import { applySecretsToConfig, validateConfigSecrets } from './secrets';

describe(getName(__filename), () => {
describe(getName(), () => {
describe('validateConfigSecrets(config)', () => {
it('works with default config', () => {
expect(() => validateConfigSecrets(defaultConfig)).not.toThrow();
Expand Down
2 changes: 1 addition & 1 deletion lib/config/validation-helpers/managers.spec.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { getName } from '../../../test/util';
import { check } from './managers';

describe(getName(__filename), () => {
describe(getName(), () => {
it('should have no errors', () => {
const res = check({
resolvedRule: { matchManagers: ['npm'] },
Expand Down
2 changes: 1 addition & 1 deletion lib/config/validation.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { getName } from '../../test/util';
import type { RenovateConfig } from './types';
import * as configValidation from './validation';

describe(getName(__filename), () => {
describe(getName(), () => {
describe('getParentName()', () => {
it('ignores encrypted in root', () => {
expect(configValidation.getParentName('encrypted')).toEqual('');
Expand Down
2 changes: 1 addition & 1 deletion lib/datasource/bitbucket-tags/index.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import * as httpMock from '../../../test/http-mock';
import { getName } from '../../../test/util';
import { id as datasource } from '.';

describe(getName(__filename), () => {
describe(getName(), () => {
beforeEach(() => {
httpMock.reset();
httpMock.setup();
Expand Down
6 changes: 3 additions & 3 deletions lib/datasource/cdnjs/index.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,15 @@ import { getName, loadFixture } from '../../../test/util';
import { EXTERNAL_HOST_ERROR } from '../../constants/error-messages';
import { id as datasource } from '.';

const res1 = loadFixture(__filename, 'd3-force.json');
const res2 = loadFixture(__filename, 'bulma.json');
const res1 = loadFixture('d3-force.json');
const res2 = loadFixture('bulma.json');

const baseUrl = 'https://api.cdnjs.com/';

const pathFor = (s: string): string =>
`/libraries/${s.split('/').shift()}?fields=homepage,repository,assets`;

describe(getName(__filename), () => {
describe(getName(), () => {
describe('getReleases', () => {
beforeEach(() => {
jest.clearAllMocks();
Expand Down
8 changes: 4 additions & 4 deletions lib/datasource/crate/index.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,9 @@ import {
jest.mock('simple-git');
const simpleGit: any = _simpleGit;

const res1 = loadFixture(__filename, 'libc');
const res2 = loadFixture(__filename, 'amethyst');
const res3 = loadFixture(__filename, 'mypkg');
const res1 = loadFixture('libc');
const res2 = loadFixture('amethyst');
const res3 = loadFixture('mypkg');

const baseUrl =
'https://raw.githubusercontent.com/rust-lang/crates.io-index/master/';
Expand Down Expand Up @@ -65,7 +65,7 @@ function setupErrorGitMock(): { mockClone: jest.Mock<any, any> } {
return { mockClone };
}

describe(getName(__filename), () => {
describe(getName(), () => {
describe('getIndexSuffix', () => {
it('returns correct suffixes', () => {
expect(getIndexSuffix('a')).toStrictEqual(['1', 'a']);
Expand Down
4 changes: 2 additions & 2 deletions lib/datasource/dart/index.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@ import * as httpMock from '../../../test/http-mock';
import { getName, loadJsonFixture } from '../../../test/util';
import { id as datasource } from '.';

const body = loadJsonFixture(__filename, 'shared_preferences.json');
const body = loadJsonFixture('shared_preferences.json');

const baseUrl = 'https://pub.dartlang.org/api/packages/';

describe(getName(__filename), () => {
describe(getName(), () => {
beforeEach(() => {
httpMock.setup();
});
Expand Down
2 changes: 1 addition & 1 deletion lib/datasource/docker/index.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ function mockEcrAuthReject(msg: string) {
);
}

describe(getName(__filename), () => {
describe(getName(), () => {
beforeEach(() => {
httpMock.setup();
hostRules.find.mockReturnValue({
Expand Down
11 changes: 2 additions & 9 deletions lib/datasource/galaxy-collection/index.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,30 +4,23 @@ import { getName, loadFixture } from '../../../test/util';

import { id as datasource } from '.';

const communityKubernetesBase = loadFixture(
__filename,
'community_kubernetes_base.json'
);
const communityKubernetesBase = loadFixture('community_kubernetes_base.json');
const communityKubernetesVersions = loadFixture(
__filename,
'community_kubernetes_versions.json'
);
const communityKubernetesDetails121 = loadFixture(
__filename,
'community_kubernetes_version_details_1.2.1.json'
);
const communityKubernetesDetails120 = loadFixture(
__filename,
'community_kubernetes_version_details_1.2.0.json'
);
const communityKubernetesDetails0111 = loadFixture(
__filename,
'community_kubernetes_version_details_0.11.1.json'
);

const baseUrl = 'https://galaxy.ansible.com';

describe(getName(__filename), () => {
describe(getName(), () => {
describe('getReleases', () => {
beforeEach(() => {
httpMock.setup();
Expand Down
6 changes: 3 additions & 3 deletions lib/datasource/galaxy/index.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,12 @@ import { getName, loadFixture } from '../../../test/util';

import { id as datasource } from '.';

const res1 = loadFixture(__filename, 'timezone');
const empty = loadFixture(__filename, 'empty');
const res1 = loadFixture('timezone');
const empty = loadFixture('empty');

const baseUrl = 'https://galaxy.ansible.com/';

describe(getName(__filename), () => {
describe(getName(), () => {
describe('getReleases', () => {
beforeEach(() => {
httpMock.setup();
Expand Down
4 changes: 2 additions & 2 deletions lib/datasource/git-refs/index.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@ const simpleGit: any = _simpleGit;

const depName = 'https://github.com/example/example.git';

const lsRemote1 = loadFixture(__filename, 'ls-remote-1.txt');
const lsRemote1 = loadFixture('ls-remote-1.txt');

describe(getName(__filename), () => {
describe(getName(), () => {
describe('getReleases', () => {
it('returns nil if response is wrong', async () => {
simpleGit.mockReturnValue({
Expand Down
4 changes: 2 additions & 2 deletions lib/datasource/git-tags/index.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@ const simpleGit: any = _simpleGit;

const depName = 'https://github.com/example/example.git';

const lsRemote1 = loadFixture(__filename, 'ls-remote-1.txt', '../git-refs');
const lsRemote1 = loadFixture('ls-remote-1.txt', '../git-refs');

describe(getName(__filename), () => {
describe(getName(), () => {
describe('getReleases', () => {
it('returns nil if response is wrong', async () => {
simpleGit.mockReturnValue({
Expand Down
2 changes: 1 addition & 1 deletion lib/datasource/github-releases/index.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ const responseBody = [
},
];

describe(getName(__filename), () => {
describe(getName(), () => {
beforeEach(() => {
hostRules.hosts.mockReturnValue([]);
hostRules.find.mockReturnValue({
Expand Down
2 changes: 1 addition & 1 deletion lib/datasource/github-tags/index.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ const hostRules: any = _hostRules;
const githubApiHost = 'https://api.github.com';
const githubEnterpriseApiHost = 'https://git.enterprise.com';

describe(getName(__filename), () => {
describe(getName(), () => {
beforeEach(() => {
httpMock.reset();
httpMock.setup();
Expand Down
2 changes: 1 addition & 1 deletion lib/datasource/gitlab-tags/index.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import * as httpMock from '../../../test/http-mock';
import { getName } from '../../../test/util';
import { id as datasource } from '.';

describe(getName(__filename), () => {
describe(getName(), () => {
beforeEach(() => {
httpMock.reset();
httpMock.setup();
Expand Down
Loading

0 comments on commit 0f50ae2

Please sign in to comment.