Report the number of tests
This commit is contained in:
parent
c928be028a
commit
4117eb71cc
1 changed files with 6 additions and 1 deletions
|
@ -4,9 +4,11 @@ define([], function () {
|
||||||
var locks = [];
|
var locks = [];
|
||||||
var tests = [];
|
var tests = [];
|
||||||
var failed = false;
|
var failed = false;
|
||||||
|
var totalTests = 0;
|
||||||
var out = window.__CRYPTPAD_TEST_OBJ__ = function (f) {
|
var out = window.__CRYPTPAD_TEST_OBJ__ = function (f) {
|
||||||
if (!out.testing) { return; }
|
if (!out.testing) { return; }
|
||||||
tests.push(f);
|
tests.push(f);
|
||||||
|
totalTests++;
|
||||||
var runLock = function (lock) {
|
var runLock = function (lock) {
|
||||||
lock(function () { setTimeout(function () { runLock(locks.shift()); }); });
|
lock(function () { setTimeout(function () { runLock(locks.shift()); }); });
|
||||||
};
|
};
|
||||||
|
@ -18,7 +20,10 @@ define([], function () {
|
||||||
throw new Error("Pass called on an unknown test (called multiple times?)");
|
throw new Error("Pass called on an unknown test (called multiple times?)");
|
||||||
}
|
}
|
||||||
tests.splice(i, 1);
|
tests.splice(i, 1);
|
||||||
if (!tests.length) { out.passed(); }
|
if (!tests.length) {
|
||||||
|
console.log("Completed " + totalTests + " successfully");
|
||||||
|
out.passed();
|
||||||
|
}
|
||||||
},
|
},
|
||||||
fail: function (reason) {
|
fail: function (reason) {
|
||||||
failed = true;
|
failed = true;
|
||||||
|
|
Loading…
Reference in a new issue