renovate/test/config/massage.spec.js
Rhys Arkins 16d36a15e2 feat: add npmToken, npmrc and yarnrc configuration support (#753)
Renovate config can now support the fields `npmToken`, `npmrc` and `yarnrc`. `npmrc` and `yarnrc` (note no `.` prefix) can be used as an alternative to checking the respective files into the repo and have the same effect. `npmToken` is a shorter alternative and allows for just the npm token to be added, defaulting to the public npm registry.
2017-08-29 09:25:44 +02:00

24 lines
679 B
JavaScript

const massage = require('../../lib/config/massage.js');
describe('config/massage', () => {
describe('massageConfig', () => {
it('returns empty', () => {
const config = {};
const res = massage.massageConfig(config);
expect(res).toMatchSnapshot();
});
it('massages strings to array', () => {
const config = {
schedule: 'before 5am',
};
const res = massage.massageConfig(config);
expect(Array.isArray(res.schedule)).toBe(true);
});
it('massages npmToken', () => {
const config = {
npmToken: 'some-token',
};
expect(massage.massageConfig(config)).toMatchSnapshot();
});
});
});