renovate/test/config/file.spec.js
Rishabh Jain c1663e3db1 tests: move fixtures to corresponding directories (#3351)
- Refactor: move fixtures to corresponding directories
- Delete unused fixtures

Resolves: #3328
2019-03-11 16:50:10 +01:00

25 lines
872 B
JavaScript

const path = require('path');
const file = require('../../lib/config/file.js');
const customConfig = require('./config/_fixtures/file');
describe('config/file', () => {
describe('.getConfig()', () => {
it('returns empty env', () => {
expect(file.getConfig({ RENOVATE_CONFIG_FILE: 'dummylocation' })).toEqual(
{}
);
});
it('parses custom config file', () => {
const configFile = path.resolve(__dirname, './config/_fixtures/file.js');
expect(file.getConfig({ RENOVATE_CONFIG_FILE: configFile })).toEqual(
customConfig
);
});
it('migrates', () => {
const configFile = path.resolve(__dirname, './config/_fixtures/file2.js');
const res = file.getConfig({ RENOVATE_CONFIG_FILE: configFile });
expect(res).toMatchSnapshot();
expect(res.rangeStrategy).toEqual('bump');
});
});
});