8000 Revert JSUnity improvement, testCase names now need to be unique per … · arangodb/arangodb@0984445 · GitHub
[go: up one dir, main page]

Skip to content

Commit 0984445

Browse files
committed
Revert JSUnity improvement, testCase names now need to be unique per file again. :sad: (#14659)
1 parent a3b91f2 commit 0984445

File tree

1 file changed

+8
-11
lines changed

1 file changed

+8
-11
lines changed

js/common/modules/jsunity.js

Lines changed: 8 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -278,31 +278,28 @@ function Run (testsuite) {
278278
PASSED += result.passed;
279279
FAILED += result.failed;
280280
DURATION += result.duration;
281-
COMPLETE[suite.suiteName] = COMPLETE[suite.suiteName] || {};
282281

283282
let duplicates = [];
284-
// Reference will be modified within complete
285-
let cmpl = COMPLETE[suite.suiteName];
286283
for (var attrname in RESULTS) {
287284
if (typeof(RESULTS[attrname]) === 'number') {
288-
if (!cmpl.hasOwnProperty(attrname)) {
289-
cmpl[attrname] = { };
285+
if (!COMPLETE.hasOwnProperty(attrname)) {
286+
COMPLETE[attrname] = { };
290287
}
291-
cmpl[attrname] = RESULTS[attrname];
288+
COMPLETE[attrname][suite.suiteName] = RESULTS[attrname];
292289
} else if (RESULTS.hasOwnProperty(attrname)) {
293-
if (cmpl.hasOwnProperty(attrname)) {
290+
if (COMPLETE.hasOwnProperty(attrname)) {
294291
if (attrname === 'message') {
295-
cmpl[attrname] += "\n\n" + RESULTS[attrname];
292+
COMPLETE[attrname] += "\n\n" + RESULTS[attrname];
296293
continue;
297294
}
298-
print("Duplicate testcase '" + suite.suiteName + "::" + attrname + "' - already have: " + JSON.stringify(cmpl[attrname]) + "");
295+
print("Duplicate testsuite '" + attrname + "' - already have: " + JSON.stringify(COMPLETE[attrname]) + "");
299296
duplicates.push(attrname);
300297
}
301-
cmpl[attrname] = RESULTS[attrname];
298+
COMPLETE[attrname] = RESULTS[attrname];
302299
}
303300
}
304301
if (duplicates.length !== 0) {
305-
throw("Duplicate testcase '" + duplicates + "'");
302+
throw("Duplicate testsuite '" + duplicates + "'");
306303
}
307304
return result;
308305
}

0 commit comments

Comments
 (0)
0