bpmnlint 7.6.0 → 7.7.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +4 -0
- package/lib/testers/rule-tester.js +35 -3
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -6,6 +6,10 @@ All notable changes to [bpmnlint](https://github.com/bpmn-io/bpmnlint) are docum
|
|
|
6
6
|
|
|
7
7
|
___Note:__ Yet to be released changes appear here._
|
|
8
8
|
|
|
9
|
+
## 7.7.0
|
|
10
|
+
|
|
11
|
+
* `FEAT`: fuzzy test for equality of nodes when using `RuleTester#verify` ([#79](https://github.com/bpmn-io/bpmnlint/pull/79/files))
|
|
12
|
+
|
|
9
13
|
## 7.6.0
|
|
10
14
|
|
|
11
15
|
* `FEAT`: allow passing object as third parameter to `Reporter#report` ([#75](https://github.com/bpmn-io/bpmnlint/pull/75))
|
|
@@ -11,7 +11,7 @@ function createResolver(rule) {
|
|
|
11
11
|
}
|
|
12
12
|
|
|
13
13
|
function expectEqual(a, b) {
|
|
14
|
-
assert.deepStrictEqual(a, b);
|
|
14
|
+
assert.deepStrictEqual(JSON.stringify(a, replacer, 2), JSON.stringify(b, replacer, 2));
|
|
15
15
|
}
|
|
16
16
|
|
|
17
17
|
|
|
@@ -99,6 +99,38 @@ function getTitle(idx, name) {
|
|
|
99
99
|
}
|
|
100
100
|
|
|
101
101
|
module.exports = {
|
|
102
|
+
expectEqual,
|
|
102
103
|
verify,
|
|
103
|
-
getTitle
|
|
104
|
-
|
|
104
|
+
getTitle,
|
|
105
|
+
replacer
|
|
106
|
+
};
|
|
107
|
+
|
|
108
|
+
function replacer(_, value) {
|
|
109
|
+
if (!value) {
|
|
110
|
+
return value;
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
const { $type } = value;
|
|
114
|
+
|
|
115
|
+
if ($type) {
|
|
116
|
+
const { $descriptor } = value;
|
|
117
|
+
|
|
118
|
+
const { idProperty } = $descriptor;
|
|
119
|
+
|
|
120
|
+
if (idProperty) {
|
|
121
|
+
const { name } = idProperty;
|
|
122
|
+
|
|
123
|
+
const id = value.get(name);
|
|
124
|
+
|
|
125
|
+
if (id) {
|
|
126
|
+
return id;
|
|
127
|
+
} else {
|
|
128
|
+
return $type;
|
|
129
|
+
}
|
|
130
|
+
} else {
|
|
131
|
+
return $type;
|
|
132
|
+
}
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
return value;
|
|
136
|
+
}
|