Skip to content
Snippets Groups Projects
Commit 540d47ba authored by Rhys Arkins's avatar Rhys Arkins
Browse files

chore: fix lint

parent 1ddbce2f
No related branches found
No related tags found
No related merge requests found
...@@ -7,9 +7,9 @@ import { ...@@ -7,9 +7,9 @@ import {
} from '../../../../test/util'; } from '../../../../test/util';
import * as _migrateAndValidate from '../../../config/migrate-validate'; import * as _migrateAndValidate from '../../../config/migrate-validate';
import { import {
mergeRenovateConfig,
detectRepoFileConfig,
checkForRepoConfigError, checkForRepoConfigError,
detectRepoFileConfig,
mergeRenovateConfig,
} from './config'; } from './config';
jest.mock('../../../util/fs'); jest.mock('../../../util/fs');
...@@ -29,12 +29,12 @@ jest.mock('../../../config/migrate-validate'); ...@@ -29,12 +29,12 @@ jest.mock('../../../config/migrate-validate');
describe('workers/repository/init/config', () => { describe('workers/repository/init/config', () => {
describe('detectRepoFileConfig()', () => { describe('detectRepoFileConfig()', () => {
it('returns config if not found', async () => { it('returns config if not found', () => {
git.getFileList.mockResolvedValue(['package.json']); git.getFileList.mockResolvedValue(['package.json']);
fs.readLocalFile.mockResolvedValue('{}'); fs.readLocalFile.mockResolvedValue('{}');
expect(detectRepoFileConfig()).toMatchSnapshot(); expect(detectRepoFileConfig()).toMatchSnapshot();
}); });
it('uses package.json config if found', async () => { it('uses package.json config if found', () => {
git.getFileList.mockResolvedValue(['package.json']); git.getFileList.mockResolvedValue(['package.json']);
const pJson = JSON.stringify({ const pJson = JSON.stringify({
name: 'something', name: 'something',
...@@ -45,26 +45,26 @@ describe('workers/repository/init/config', () => { ...@@ -45,26 +45,26 @@ describe('workers/repository/init/config', () => {
fs.readLocalFile.mockResolvedValue(pJson); fs.readLocalFile.mockResolvedValue(pJson);
expect(detectRepoFileConfig()).toMatchSnapshot(); expect(detectRepoFileConfig()).toMatchSnapshot();
}); });
it('returns error if cannot parse', async () => { it('returns error if cannot parse', () => {
git.getFileList.mockResolvedValue(['package.json', 'renovate.json']); git.getFileList.mockResolvedValue(['package.json', 'renovate.json']);
fs.readLocalFile.mockResolvedValue('cannot parse'); fs.readLocalFile.mockResolvedValue('cannot parse');
expect(detectRepoFileConfig()).toMatchSnapshot(); expect(detectRepoFileConfig()).toMatchSnapshot();
}); });
it('throws error if duplicate keys', async () => { it('throws error if duplicate keys', () => {
git.getFileList.mockResolvedValue(['package.json', '.renovaterc']); git.getFileList.mockResolvedValue(['package.json', '.renovaterc']);
fs.readLocalFile.mockResolvedValue( fs.readLocalFile.mockResolvedValue(
'{ "enabled": true, "enabled": false }' '{ "enabled": true, "enabled": false }'
); );
expect(detectRepoFileConfig()).toMatchSnapshot(); expect(detectRepoFileConfig()).toMatchSnapshot();
}); });
it('finds and parse renovate.json5', async () => { it('finds and parse renovate.json5', () => {
git.getFileList.mockResolvedValue(['package.json', 'renovate.json5']); git.getFileList.mockResolvedValue(['package.json', 'renovate.json5']);
fs.readLocalFile.mockResolvedValue(`{ fs.readLocalFile.mockResolvedValue(`{
// this is json5 format // this is json5 format
}`); }`);
expect(detectRepoFileConfig()).toMatchSnapshot(); expect(detectRepoFileConfig()).toMatchSnapshot();
}); });
it('finds .github/renovate.json', async () => { it('finds .github/renovate.json', () => {
git.getFileList.mockResolvedValue([ git.getFileList.mockResolvedValue([
'package.json', 'package.json',
'.github/renovate.json', '.github/renovate.json',
...@@ -72,7 +72,7 @@ describe('workers/repository/init/config', () => { ...@@ -72,7 +72,7 @@ describe('workers/repository/init/config', () => {
fs.readLocalFile.mockResolvedValue('{}'); fs.readLocalFile.mockResolvedValue('{}');
expect(detectRepoFileConfig()).toMatchSnapshot(); expect(detectRepoFileConfig()).toMatchSnapshot();
}); });
it('finds .gitlab/renovate.json', async () => { it('finds .gitlab/renovate.json', () => {
git.getFileList.mockResolvedValue([ git.getFileList.mockResolvedValue([
'package.json', 'package.json',
'.gitlab/renovate.json', '.gitlab/renovate.json',
...@@ -80,7 +80,7 @@ describe('workers/repository/init/config', () => { ...@@ -80,7 +80,7 @@ describe('workers/repository/init/config', () => {
fs.readLocalFile.mockResolvedValue('{}'); fs.readLocalFile.mockResolvedValue('{}');
expect(detectRepoFileConfig()).toMatchSnapshot(); expect(detectRepoFileConfig()).toMatchSnapshot();
}); });
it('finds .renovaterc.json', async () => { it('finds .renovaterc.json', () => {
git.getFileList.mockResolvedValue(['package.json', '.renovaterc.json']); git.getFileList.mockResolvedValue(['package.json', '.renovaterc.json']);
fs.readLocalFile.mockResolvedValue('{}'); fs.readLocalFile.mockResolvedValue('{}');
expect(detectRepoFileConfig()).toMatchSnapshot(); expect(detectRepoFileConfig()).toMatchSnapshot();
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment