Make sure that empty config options don't accidently label things

This commit is contained in:
Josh Dales
2023-03-20 17:39:57 -04:00
parent 92990c0c57
commit d31255f7be
4 changed files with 26 additions and 17 deletions

View File

@@ -17,17 +17,18 @@ describe('toMatchConfig', () => {
'head-branch': ['testing-head'],
'base-branch': ['testing-base']
};
const expected: MatchConfig = {
changedFiles: {
all: ['testing-all'],
any: ['testing-any']
},
headBranch: ['testing-head'],
baseBranch: ['testing-base']
};
it('returns a MatchConfig object with all options', () => {
const result = toMatchConfig(config);
expect(result).toEqual<MatchConfig>({
changedFiles: {
all: ['testing-all'],
any: ['testing-any']
},
headBranch: ['testing-head'],
baseBranch: ['testing-base']
});
expect(result).toEqual(expected);
});
describe('and there are also unexpected options present', () => {
@@ -35,14 +36,7 @@ describe('toMatchConfig', () => {
it('does not include the unexpected items in the returned MatchConfig object', () => {
const result = toMatchConfig(config);
expect(result).toEqual<MatchConfig>({
changedFiles: {
all: ['testing-all'],
any: ['testing-any']
},
headBranch: ['testing-head'],
baseBranch: ['testing-base']
});
expect(result).toEqual(expected);
});
});
});