From 29acfe580373bc3961608e146e28748b9168fda6 Mon Sep 17 00:00:00 2001 From: kema-dev Date: Fri, 17 Jan 2025 18:40:51 +0100 Subject: [PATCH] test(action): add test for invoking command with config file Signed-off-by: kema-dev --- tests/grype_command.test.js | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/tests/grype_command.test.js b/tests/grype_command.test.js index 3da4b5a8..de1c1b5f 100644 --- a/tests/grype_command.test.js +++ b/tests/grype_command.test.js @@ -99,6 +99,32 @@ describe("Grype command args", () => { ]); }); + it("is invoked with config file", async () => { + const args = await mockRun({ + image: "asdf", + "fail-build": "false", + "output-file": "the-output-file", + "output-format": "json", + "severity-cutoff": "low", + version: "0.6.0", + "only-fixed": "false", + "add-cpes-if-none": "false", + "by-cve": "false", + "config-file-path": "path/to/config", + }); + expect(args).toEqual([ + "-o", + "json", + "--file", + "the-output-file", + "--config", + "path/to/config", + "--fail-on", + "low", + "asdf", + ]); + }); + it("adds missing CPEs if requested", async () => { const args = await mockRun({ image: "asdf",