Skip to content

Commit 914c9c4

Browse files
committed
using lodash flatMap
1 parent 06eb858 commit 914c9c4

File tree

1 file changed

+4
-6
lines changed

1 file changed

+4
-6
lines changed

spec/SecurityCheck.spec.js

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
'use strict';
22

3+
const _ = require('lodash');
34
const Utils = require('../lib/Utils');
45
const Config = require('../lib/Config');
56
const request = require('../lib/request');
@@ -330,12 +331,9 @@ describe('Security Check', () => {
330331
const checkGroups = [Group];
331332
const runner = new CheckRunner({ checkGroups, enableCheckLog: true });
332333
const report = await runner.run();
333-
console.log(JSON.stringify(report));
334-
expect(report).toBeDefined();
335-
expect(report.report).toBeDefined();
336-
expect(report.report.groups).toBeDefined();
337-
expect(report.report.groups.length).toBe(1);
338-
const titles = report.report.groups.flatMap(group => group.checks.map(check => check.title));
334+
const titles = _.flatMap(report.report.groups, group =>
335+
group.checks.map(check => check.title)
336+
);
339337
expect(titles.length).toBe(2);
340338

341339
for (const title of titles) {

0 commit comments

Comments
 (0)