This repository was archived by the owner on Oct 14, 2020. It is now read-only.
File tree Expand file tree Collapse file tree 2 files changed +37
-1
lines changed
tests/integration/generic Expand file tree Collapse file tree 2 files changed +37
-1
lines changed Original file line number Diff line number Diff line change @@ -321,10 +321,18 @@ jobs:
321321 cd tests/integration/
322322 npm ci
323323 # This steps should include Integration tests which are not related to a Specific Scanner
324- - name : " Generic Integration Tests"
324+ - name : " Throws NoScanDefiniton Error Integration Tests"
325325 run : |
326326 cd tests/integration/
327327 npx jest --ci --color no-scan-definition-error
328+ - name : " Hooks Integration Tests"
329+ run : |
330+ helm -n integration-tests install update-category ./hooks/update-field --set="attribute.name=category" --set="attribute.value=fancy-category"
331+ helm -n integration-tests install update-severity ./hooks/update-field --set="attribute.name=severity" --set="attribute.value=high"
332+ helm -n integration-tests install test-scan ./integrations/test-scan
333+ cd tests/integration/
334+ npx jest --ci --color read-write-hook
335+ helm -n integration-tests uninstall test-scan update-category update-severity
328336 - name : " nmap Integration Tests"
329337 run : |
330338 helm -n integration-tests install nmap ./integrations/nmap/ --set="parserImage.tag=sha-$(git rev-parse --short HEAD)"
Original file line number Diff line number Diff line change 1+ const { scan } = require ( "../helpers" ) ;
2+
3+ test (
4+ "localhost port scan should only find a host finding" ,
5+ async ( ) => {
6+ const { categories, severities, count } = await scan (
7+ "test-scan-read-write-hook" ,
8+ "test-scan" ,
9+ [ ] ,
10+ 90
11+ ) ;
12+
13+ expect ( count ) . toBe ( 2 ) ;
14+ expect ( categories ) . toMatchInlineSnapshot ( `
15+ Object {
16+ "Host": 1,
17+ "Open Port": 1,
18+ "fancy-category": 2,
19+ }
20+ ` ) ;
21+ expect ( severities ) . toMatchInlineSnapshot ( `
22+ Object {
23+ "high": 2,
24+ }
25+ ` ) ;
26+ } ,
27+ 3 * 60 * 1000
28+ ) ;
You can’t perform that action at this time.
0 commit comments