Skip to content

Commit

Permalink
test(action): add test for invoking command with config file
Browse files Browse the repository at this point in the history
Signed-off-by: kema-dev <github@kema.dev>
  • Loading branch information
kema-dev committed Jan 17, 2025
1 parent a17ee0b commit 06728cf
Showing 1 changed file with 26 additions and 0 deletions.
26 changes: 26 additions & 0 deletions tests/grype_command.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down

0 comments on commit 06728cf

Please sign in to comment.