Add an extra test now that we can check the base branch

This commit is contained in:
Josh Dales
2023-01-28 18:08:48 -05:00
parent 0b6e68d75a
commit 2daf35ae4b

View File

@@ -32,6 +32,9 @@ describe('checkBranch', () => {
github.context.payload.pull_request!.head = {
ref: 'test/feature/123'
};
github.context.payload.pull_request!.base = {
ref: 'main'
};
});
describe('when a single pattern is provided', () => {
@@ -72,4 +75,13 @@ describe('checkBranch', () => {
});
});
});
describe('when the branch to check is specified as the base branch', () => {
describe('and the pattern matches the base branch', () => {
it('returns true', () => {
const result = checkBranch(['^main$'], 'base');
expect(result).toBe(true);
});
});
});
});