Skip to content

Commit 8e23a0b

Browse files
committed
Added some unit test logging
1 parent 1593a7c commit 8e23a0b

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

.editorconfig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ root = true
33

44
[*]
55
indent_style = space
6-
indent_size = 4
6+
indent_size = 2
77
end_of_line = lf
88
charset = utf-8
99
trim_trailing_whitespace = true

spec/tracekit-spec.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,6 @@
117117
//this.timeout(3000);
118118

119119
beforeEach(function () {
120-
121120
// Prevent the onerror call that's part of our tests from getting to
122121
// mocha's handler, which would treat it as a test failure.
123122
//
@@ -126,9 +125,14 @@
126125
// be installed once.
127126
oldOnErrorHandler = window.onerror;
128127
window.onerror = function (message, url, lineNo, error) {
128+
var shouldLog = message !== "__mocha_ignore__";
129+
shouldLog && console.log("window.onerror(" + message + ", " + url + ", " + lineNo + ", " + error + ")");
129130
if (message === testMessage || lineNo === testLineNo) {
131+
shouldLog && console.log("matches test message and line number");
130132
return true;
131133
}
134+
135+
shouldLog && console.log("Calling previous handler", oldOnErrorHandler)
132136
return oldOnErrorHandler.apply(this, arguments);
133137
};
134138
});

0 commit comments

Comments
 (0)