Skip to content

Commit

Permalink
test: add rule that errors
Browse files Browse the repository at this point in the history
  • Loading branch information
philippfromme committed Jul 3, 2023
1 parent e02b41e commit 2c84d5f
Showing 1 changed file with 30 additions and 1 deletion.
31 changes: 30 additions & 1 deletion test/spec/LintingSpec.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@ import {

import Modeler from 'bpmn-js/lib/Modeler';

import { is } from 'bpmn-js/lib/util/ModelUtil';

import StaticResolver from 'bpmnlint/lib/resolver/static-resolver';

import LintModule from '../../lib';

import bpmnlintrc from './.bpmnlintrc';
Expand Down Expand Up @@ -252,7 +256,32 @@ describe('linting', function() {
],
linting: {
active: true,
bpmnlint: bpmnlintrc
bpmnlint: {
config: {
extends: 'bpmnlint:recommended',
rules: {
'foo/rule-error': 'error'
}
},
resolver: new StaticResolver({
'config:bpmnlint/recommended': require('bpmnlint/config/recommended'),
...Object.keys(require('bpmnlint/config/recommended').rules).reduce((rules, rule) => {
return {
...rules,
[`rule:bpmnlint/${ rule }`]: require(`bpmnlint/rules/${ rule }`)
};
}, {}),
'rule:bpmnlint-plugin-foo/rule-error': function() {
return {
check(node) {
if (is(node, 'bpmn:Process')) {
throw new Error('Rule error!');
}
}
};
}
})
}
}
});
});
Expand Down

0 comments on commit 2c84d5f

Please sign in to comment.