mirror of
https://github.com/actions/labeler.git
synced 2025-12-13 04:57:21 +00:00
Implement dot option
This commit is contained in:
@@ -15,15 +15,29 @@ const matchConfig = [{ any: ["*.txt"] }];
|
||||
describe("checkGlobs", () => {
|
||||
it("returns true when our pattern does match changed files", () => {
|
||||
const changedFiles = ["foo.txt", "bar.txt"];
|
||||
const result = checkGlobs(changedFiles, matchConfig);
|
||||
const result = checkGlobs(changedFiles, matchConfig, false);
|
||||
|
||||
expect(result).toBeTruthy();
|
||||
});
|
||||
|
||||
it("returns false when our pattern does not match changed files", () => {
|
||||
const changedFiles = ["foo.docx"];
|
||||
const result = checkGlobs(changedFiles, matchConfig);
|
||||
const result = checkGlobs(changedFiles, matchConfig, false);
|
||||
|
||||
expect(result).toBeFalsy();
|
||||
});
|
||||
|
||||
it("returns false for a file starting with dot if `dot` option is false", () => {
|
||||
const changedFiles = [".foo.txt"];
|
||||
const result = checkGlobs(changedFiles, matchConfig, false);
|
||||
|
||||
expect(result).toBeFalsy();
|
||||
});
|
||||
|
||||
it("returns false for a file starting with dot if `dot` option is true", () => {
|
||||
const changedFiles = [".foo.txt"];
|
||||
const result = checkGlobs(changedFiles, matchConfig, true);
|
||||
|
||||
expect(result).toBeTruthy();
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user