Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fixed bug issue #3675 #4034

Closed
wants to merge 3 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 0 additions & 4 deletions lib/reporters/base.js
Original file line number Diff line number Diff line change
Expand Up @@ -239,7 +239,6 @@ exports.list = function(failures) {
color('error title', ' %s) %s:\n%s') + color('error stack', '\n%s\n');
var match = message.match(/^([^:]+): expected/);
msg = '\n ' + color('error message', match ? match[1] : msg);

msg += generateDiff(err.actual, err.expected);
}

Expand Down Expand Up @@ -276,7 +275,6 @@ exports.list = function(failures) {
*/
function Base(runner, options) {
var failures = (this.failures = []);

if (!runner) {
throw new TypeError('Missing runner argument');
}
Expand Down Expand Up @@ -333,9 +331,7 @@ Base.prototype.epilogue = function() {
// failures
if (stats.failures) {
fmt = color('fail', ' %d failing');

Base.consoleLog(fmt, stats.failures);

Base.list(this.failures);
Base.consoleLog();
}
Expand Down
2 changes: 0 additions & 2 deletions lib/runnable.js
Original file line number Diff line number Diff line change
Expand Up @@ -349,7 +349,6 @@ Runnable.prototype.run = function(fn) {
// the failure.
throw new Pending('async skip; aborting execution');
};

if (this.allowUncaught) {
return callFnAsync(this.fn);
}
Expand All @@ -361,7 +360,6 @@ Runnable.prototype.run = function(fn) {
}
return;
}

if (this.allowUncaught) {
if (this.isPending()) {
done();
Expand Down
10 changes: 5 additions & 5 deletions lib/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -235,7 +235,6 @@ var type = (exports.type = function type(value) {
*/
exports.stringify = function(value) {
var typeHint = type(value);

if (!~['object', 'array', 'function'].indexOf(typeHint)) {
if (typeHint === 'buffer') {
var json = Buffer.prototype.toJSON.call(value);
Expand Down Expand Up @@ -343,17 +342,18 @@ function jsonStringify(object, spaces, depth) {
}
--length;
str +=
'\n ' +
repeat(' ', space) +
(Array.isArray(object) ? '' : '"' + i + '": ') + // key
// '\n ' +
repeat('', space) +
(Array.isArray(object) ? '' : '"' + i + '":') + // key
_stringify(object[i]) + // value
(length ? ',' : ''); // comma
}

return (
str +
// [], {}
(str.length !== 1 ? '\n' + repeat(' ', --space) + end : end)
// (str.length !== 1 ? '\n' + repeat(' ', --space) + end : end)
(str.length !== 1 ? repeat('', --space) + end : end)
);
}

Expand Down
12 changes: 9 additions & 3 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -516,7 +516,7 @@
"browser-stdout": "1.3.1",
"chokidar": "3.0.2",
"debug": "3.2.6",
"diff": "3.5.0",
"diff": "^4.0.1",
"escape-string-regexp": "1.0.5",
"find-up": "3.0.0",
"glob": "7.1.3",
Expand Down