forked from secureCodeBox/secureCodeBox
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcli.test.js
More file actions
25 lines (21 loc) · 654 Bytes
/
cli.test.js
File metadata and controls
25 lines (21 loc) · 654 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
const { Time } = require('./sdk');
const child_process = require('child_process');
test(
'finds open juice-shop ports when started via cli',
async () => {
const authstring = `${global.username}:${global.password}`;
child_process.execSync(
`./run_scanner.sh -a ${authstring} nmap juice-shop`,
{
cwd: '../cli',
}
);
const { report } = require('../cli/job_nmap_result.json');
expect(report.findings.length).toBe(1);
expect(report.findings[0].description).toBe(
'Port 3000 is open using tcp protocol.'
);
expect(report.findings[0].category).toBe('Open Port');
},
1 * Time.Minute
);