Add unit tests for toMatchConfig

This commit is contained in:
Josh Dales
2023-03-18 17:10:25 -04:00
parent e9a1777eb0
commit 65b7640e45
3 changed files with 43 additions and 3 deletions

View File

@@ -87,6 +87,7 @@ describe('checkBranch', () => {
describe('toBranchMatchConfig', () => {
describe('when there are no branch keys in the config', () => {
const config = {'changed-files': [{any: ['testing']}]};
it('returns an empty object', () => {
const result = toBranchMatchConfig(config);
expect(result).toMatchObject({});
@@ -95,6 +96,7 @@ describe('toBranchMatchConfig', () => {
describe('when the config contains a head-branch option', () => {
const config = {'head-branch': ['testing']};
it('sets headBranch in the matchConfig', () => {
const result = toBranchMatchConfig(config);
expect(result).toMatchObject<BranchMatchConfig>({