Skip to content

Commit

Permalink
added unit test for programmatic @exclude header generation
Browse files Browse the repository at this point in the history
  • Loading branch information
Oaphi committed May 15, 2022
1 parent f596405 commit 5ff806b
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions test/common.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,18 @@ describe("common", () => {
});
});

it('@exclude headers should be generated', async () => {
const allExcludes = allMatches.slice(0, -1);

const content = await generate("greasemonkey", {
...directCommon,
excludes: allExcludes
});

const matched = content.match(/@exclude\s+(.+)/g) || [];
expect(matched).length(allExcludes.length);
});

it("@match headers should be generated", async () => {
const content = await generate("violentmonkey", {
...directCommon,
Expand Down

0 comments on commit 5ff806b

Please sign in to comment.