mirror of
https://github.com/actions/labeler.git
synced 2025-12-11 12:07:32 +00:00
Add an extra test now that we can check the base branch
This commit is contained in:
@@ -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);
|
||||
});
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user