-
Notifications
You must be signed in to change notification settings - Fork 2.1k
/
massage.spec.ts
44 lines (43 loc) · 1.28 KB
/
massage.spec.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
import { getName } from '../../test/util';
import * as massage from './massage';
import type { RenovateConfig } from './types';
describe(getName(__filename), () => {
describe('massageConfig', () => {
it('returns empty', () => {
const config: RenovateConfig = {};
const res = massage.massageConfig(config);
expect(res).toMatchSnapshot();
});
it('massages strings to array', () => {
const config: RenovateConfig = {
schedule: 'before 5am' as never,
};
const res = massage.massageConfig(config);
expect(Array.isArray(res.schedule)).toBe(true);
});
it('massages npmToken', () => {
const config: RenovateConfig = {
npmToken: 'some-token',
};
expect(massage.massageConfig(config)).toMatchSnapshot();
});
it('massages packageRules matchUpdateTypes', () => {
const config: RenovateConfig = {
packageRules: [
{
matchPackageNames: ['foo'],
minor: {
semanticCommitType: 'feat',
},
patch: {
semanticCommitType: 'fix',
},
},
],
};
const res = massage.massageConfig(config);
expect(res).toMatchSnapshot();
expect(res.packageRules).toHaveLength(3);
});
});
});