Skip to content

Commit

Permalink
create test based on prov flow
Browse files Browse the repository at this point in the history
  • Loading branch information
RubenHalman committed Mar 3, 2024
1 parent e22fc22 commit 6338255
Show file tree
Hide file tree
Showing 6 changed files with 2,118 additions and 966 deletions.
Binary file added .yarn/install-state.gz
Binary file not shown.
1 change: 1 addition & 0 deletions .yarnrc.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
nodeLinker: node-modules
4 changes: 0 additions & 4 deletions src/main/libs/ScanFlows.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ export function ScanFlows(flows: core.Flow[], rulesConfig?: Map<string, {}>): co
const ruleResults: core.RuleResult[] = [];
for (const rule of selectedRules) {
if (rule.supportedTypes.includes(flow.type[0])) {
try {
let config = undefined;
if (rulesConfig) {
const configKeys = keys(rulesConfig);
Expand All @@ -32,9 +31,6 @@ export function ScanFlows(flows: core.Flow[], rulesConfig?: Map<string, {}>): co
result.severity = rule.severity;
}
ruleResults.push(result);
} catch (error) {
throw new error("Something went wrong while executing " + rule.name + " in the Flow: '" + flow.name + "'");
}
}
}
flowResults.push(new core.ScanResult(flow, ruleResults));
Expand Down
22 changes: 22 additions & 0 deletions tests/errornotconst.test.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
import { assert, expect } from 'chai';
import 'mocha';
import * as core from '../src'
import CreateANewAccountWithChild from './testfiles/errornotconst.json';

describe('error not constructor test', () => {

let flow: core.Flow;

before('arrange', () => {
flow = new core.Flow({
path: './testfiles/CreateANewAccountWithChild.flow-meta.xml',
xmldata: CreateANewAccountWithChild,
});
});

it('shouldnt happen', () => {

const results: core.ScanResult[] = core.scan([flow], undefined);
expect(results[0].ruleResults.length).to.equal(12);
});
});
1 change: 1 addition & 0 deletions tests/testfiles/errornotconst.json

Large diffs are not rendered by default.

Loading

0 comments on commit 6338255

Please sign in to comment.