Skip to content

Commit 26562b0

Browse files
committed
add nikto validation
Signed-off-by: Johannes Zahn <johannes.zahn@iteratec.com>
1 parent 58c4840 commit 26562b0

2 files changed

Lines changed: 10 additions & 4 deletions

File tree

scanners/nikto/parser/parser.test.js

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,9 @@
44

55
const fs = require("fs");
66
const util = require("util");
7+
const {
8+
validate_parser,
9+
} = require("@securecodebox/parser-sdk-nodejs/parser-utils");
710

811
// eslint-disable-next-line security/detect-non-literal-fs-filename
912
const readFile = util.promisify(fs.readFile);
@@ -16,8 +19,9 @@ test("parses www.securecodebox.io result file into findings", async () => {
1619
encoding: "utf8",
1720
})
1821
);
19-
20-
expect(await parse(fileContent)).toMatchSnapshot();
22+
const findings = await parse(fileContent);
23+
await expect(validate_parser(findings)).resolves.toBeUndefined();
24+
expect(findings).toMatchSnapshot();
2125
});
2226

2327
test("parses OWASP Juice Shop result file into findings", async () => {
@@ -26,6 +30,7 @@ test("parses OWASP Juice Shop result file into findings", async () => {
2630
encoding: "utf8",
2731
})
2832
);
29-
30-
expect(await parse(fileContent)).toMatchSnapshot();
33+
const findings = await parse(fileContent);
34+
await expect(validate_parser(findings)).resolves.toBeUndefined();
35+
expect(findings).toMatchSnapshot();
3136
});

scanners/package-lock.json

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)