mirror of
https://github.com/whoisclebs/lodash.git
synced 2026-02-08 10:17:48 +00:00
Update vendor/qunit-clib and validate assert counts in each unit test.
This commit is contained in:
798
test/test.js
798
test/test.js
File diff suppressed because it is too large
Load Diff
33
vendor/qunit-clib/qunit-clib.js
vendored
33
vendor/qunit-clib/qunit-clib.js
vendored
@@ -118,9 +118,38 @@
|
|||||||
/** Used as a horizontal rule in console output */
|
/** Used as a horizontal rule in console output */
|
||||||
var hr = '----------------------------------------';
|
var hr = '----------------------------------------';
|
||||||
|
|
||||||
|
/** Used by `logInline` to clear previously logged messages */
|
||||||
|
var prevLine = '';
|
||||||
|
|
||||||
/** Shorten `context.QUnit.QUnit` to `context.QUnit` */
|
/** Shorten `context.QUnit.QUnit` to `context.QUnit` */
|
||||||
var QUnit = context.QUnit = context.QUnit.QUnit || context.QUnit;
|
var QUnit = context.QUnit = context.QUnit.QUnit || context.QUnit;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Logs an inline message to standard output.
|
||||||
|
*
|
||||||
|
* @private
|
||||||
|
* @param {string} text The text to log.
|
||||||
|
*/
|
||||||
|
var logInline = (function() {
|
||||||
|
// exit early if not Node.js
|
||||||
|
if (!(typeof process == 'object' && process && process.on && process.stdout)) {
|
||||||
|
return function() {};
|
||||||
|
}
|
||||||
|
// cleanup any inline logs when exited via `ctrl+c`
|
||||||
|
process.on('SIGINT', function() {
|
||||||
|
logInline('');
|
||||||
|
process.exit();
|
||||||
|
});
|
||||||
|
return function(text) {
|
||||||
|
var blankLine = Array(prevLine.length + 1).join(' ');
|
||||||
|
if (text.length > hr.length) {
|
||||||
|
text = text.slice(0, hr.length - 3) + '...';
|
||||||
|
}
|
||||||
|
prevLine = text;
|
||||||
|
process.stdout.write(text + blankLine.slice(text.length) + '\r');
|
||||||
|
}
|
||||||
|
}());
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* A logging callback triggered when all testing is completed.
|
* A logging callback triggered when all testing is completed.
|
||||||
*
|
*
|
||||||
@@ -137,6 +166,7 @@
|
|||||||
}
|
}
|
||||||
ran = true;
|
ran = true;
|
||||||
|
|
||||||
|
logInline('');
|
||||||
console.log(hr);
|
console.log(hr);
|
||||||
console.log(' PASS: ' + details.passed + ' FAIL: ' + details.failed + ' TOTAL: ' + details.total);
|
console.log(' PASS: ' + details.passed + ' FAIL: ' + details.failed + ' TOTAL: ' + details.total);
|
||||||
console.log(' Finished in ' + details.runtime + ' milliseconds.');
|
console.log(' Finished in ' + details.runtime + ' milliseconds.');
|
||||||
@@ -230,6 +260,7 @@
|
|||||||
testName = details.name;
|
testName = details.name;
|
||||||
|
|
||||||
if (details.failed > 0) {
|
if (details.failed > 0) {
|
||||||
|
logInline('');
|
||||||
if (!modulePrinted) {
|
if (!modulePrinted) {
|
||||||
modulePrinted = true;
|
modulePrinted = true;
|
||||||
console.log(hr);
|
console.log(hr);
|
||||||
@@ -240,6 +271,8 @@
|
|||||||
assertions.forEach(function(value) {
|
assertions.forEach(function(value) {
|
||||||
console.log(' ' + value);
|
console.log(' ' + value);
|
||||||
});
|
});
|
||||||
|
} else {
|
||||||
|
logInline('Testing ' + moduleName + '...');
|
||||||
}
|
}
|
||||||
assertions.length = 0;
|
assertions.length = 0;
|
||||||
});
|
});
|
||||||
|
|||||||
Reference in New Issue
Block a user