From 5ff806b82f5964279c9eef11085e121d2f371ef6 Mon Sep 17 00:00:00 2001 From: Oleg Valter Date: Mon, 16 May 2022 02:09:11 +0300 Subject: [PATCH] added unit test for programmatic @exclude header generation --- test/common.spec.ts | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/test/common.spec.ts b/test/common.spec.ts index e727bb7..97c1350 100644 --- a/test/common.spec.ts +++ b/test/common.spec.ts @@ -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,