testilo 47.1.2 → 48.0.1

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "testilo",
3
- "version": "47.1.2",
3
+ "version": "48.0.1",
4
4
  "description": "Prepares Testaro jobs and processes Testaro reports",
5
5
  "main": "call.js",
6
6
  "scripts": {
@@ -62,8 +62,10 @@ exports.collateExcerpts = report => {
62
62
  if (pathID) {
63
63
  // Add the excerpt to the excerpt directory unless one already exists.
64
64
  excerpts[pathID][which] ??= excerpt;
65
- // Add the text to the text directory unless one already exists.
66
- texts[pathID][which] ??= text;
65
+ // Add the text, if non-empty, to the text directory unless one already exists.
66
+ if (text.length) {
67
+ texts[pathID][which] ??= text;
68
+ }
67
69
  }
68
70
  });
69
71
  }
@@ -72,15 +74,15 @@ exports.collateExcerpts = report => {
72
74
  if (Object.keys(texts).length) {
73
75
  // For each path ID in it:
74
76
  Object.keys(texts).forEach(pathID => {
75
- let toolNames = Object.keys(texts[pathID]);
76
- // Delete all empty texts.
77
- toolNames.forEach(toolName => {
78
- if (! texts[pathID][toolName]) {
79
- delete texts[pathID][toolName];
77
+ const toolNames = Object.keys(texts[pathID]);
78
+ // XXX This will be needed only temporarily!
79
+ // Ensure that all of its texts are arrays.
80
+ Object.keys(texts[pathID]).forEach(toolName => {
81
+ if (typeof texts[pathID][toolName] === 'string') {
82
+ texts[pathID][toolName] = [texts[pathID][toolName]];
80
83
  }
81
84
  });
82
- toolNames = Object.keys(texts[pathID]);
83
- // If the element has only 1 remaining text:
85
+ // If the element has only 1 text:
84
86
  if (toolNames.length === 1) {
85
87
  // Change its key to unanimous.
86
88
  texts[pathID].unanimous = texts[pathID][toolNames[0]];
@@ -93,7 +95,9 @@ exports.collateExcerpts = report => {
93
95
  Object
94
96
  .values(texts[pathID])
95
97
  .slice(1)
96
- .every(text => text === texts[pathID][toolNames[0]])
98
+ .every(
99
+ text => text.every((value, index) => value === texts[pathID][toolNames[0]][index])
100
+ )
97
101
  ) {
98
102
  // Consolidate the texts to 1 unanimous text.
99
103
  texts[pathID].unanimous = texts[pathID][toolNames[0]];