renovate/test/logger/config-serializer.spec.js
Rhys Arkins ccb66310b1 feat: Pre-fetch all package.json files (#642)
Repository initialisation is refactored so that all package files and their content is retrieved up-front before an renovating begins. This allows us to know both how many package files as well as determine if there is renovate json in a package.json before triggering the onboarding PR.

Closes #634
2017-08-08 06:25:44 +02:00

34 lines
824 B
JavaScript

const configSerializer = require('../../lib/logger/config-serializer');
describe('logger/config-serializer', () => {
it('redacts sensitive fields', () => {
const config = {
token: 'a',
nottoken: 'b',
githubAppKey: 'c',
};
expect(configSerializer(config)).toMatchSnapshot();
});
it('replaces functions', () => {
const config = {
api: 'a',
nottoken: 'b',
logger: {},
};
expect(configSerializer(config)).toMatchSnapshot();
});
it('squashes templates', () => {
const config = {
api: 'a',
nottoken: 'b',
prBody: 'foo',
};
expect(configSerializer(config)).toMatchSnapshot();
});
it('suppresses content', () => {
const config = {
content: {},
};
expect(configSerializer(config)).toMatchSnapshot();
});
});