-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathtest.js
More file actions
66 lines (56 loc) · 1.68 KB
/
test.js
File metadata and controls
66 lines (56 loc) · 1.68 KB
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
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
const { expect } = require('chai');
const { createModdle } = require('bpmnlint/lib/testers/helper');
const RuleTester = require('bpmnlint/lib/testers/rule-tester');
const manualTaskRule = require('./rules/no-manual-task');
const targetNamespaceRule = require('./rules/target-namespace');
RuleTester.verify('no-manual-task', manualTaskRule, {
valid: [
{
moddleElement: createModdle(
'<startEvent xmlns="http://www.omg.org/spec/BPMN/20100524/MODEL" id="startEvent" />',
'bpmn:StartEvent'
)
},
// during development, you may test a single rule (or skip a rule)
// by passing a custom `it` to the rule description
{
moddleElement: createModdle(
'<startEvent xmlns="http://www.omg.org/spec/BPMN/20100524/MODEL" id="startEvent" />',
'bpmn:StartEvent'
),
it: it.skip
}
],
invalid: [
{
moddleElement: createModdle(
'<manualTask xmlns="http://www.omg.org/spec/BPMN/20100524/MODEL" id="manualTask" />',
'bpmn:ManualTask'
),
report: {
id: 'manualTask',
message: 'Element has disallowed type bpmn:ManualTask'
}
}
]
});
RuleTester.verify('target-namespace', targetNamespaceRule, {
valid: [
{
moddleElement: createModdle(
'<definitions xmlns="http://www.omg.org/spec/BPMN/20100524/MODEL" id="definitions" targetNamespace="http://foo" />',
)
}
],
invalid: [
{
moddleElement: createModdle(
'<definitions xmlns="http://www.omg.org/spec/BPMN/20100524/MODEL" id="definitions" />',
),
report: {
id: 'definitions',
message: 'Element is missing targetNamespace'
}
}
]
});