Merge remote-tracking branch 'u/main' into dot-option

This commit is contained in:
Alexander Kachkaev
2023-03-27 09:39:25 +01:00
8 changed files with 1769 additions and 1150 deletions

View File

@@ -91,11 +91,20 @@ describe('run', () => {
});
it('(with sync-labels: true) it deletes preexisting PR labels that no longer match the glob pattern', async () => {
configureInput({
const mockInput = {
'repo-token': 'foo',
'configuration-path': 'bar',
'sync-labels': true
});
'sync-labels': 'true'
};
jest
.spyOn(core, 'getInput')
.mockImplementation((name: string, ...opts) => mockInput[name]);
jest
.spyOn(core, 'getBooleanInput')
.mockImplementation(
(name: string, ...opts) => mockInput[name] === 'true'
);
usingLabelerConfigYaml('only_pdfs.yml');
mockGitHubResponseChangedFiles('foo.txt');
@@ -118,11 +127,20 @@ describe('run', () => {
});
it('(with sync-labels: false) it issues no delete calls even when there are preexisting PR labels that no longer match the glob pattern', async () => {
configureInput({
const mockInput = {
'repo-token': 'foo',
'configuration-path': 'bar',
'sync-labels': false
});
'sync-labels': 'false'
};
jest
.spyOn(core, 'getInput')
.mockImplementation((name: string, ...opts) => mockInput[name]);
jest
.spyOn(core, 'getBooleanInput')
.mockImplementation(
(name: string, ...opts) => mockInput[name] === 'true'
);
usingLabelerConfigYaml('only_pdfs.yml');
mockGitHubResponseChangedFiles('foo.txt');