app/assets/javascripts/konacha/runner.js in konacha-2.0.0 vs app/assets/javascripts/konacha/runner.js in konacha-2.1.0
- old
+ new
@@ -9,22 +9,37 @@
var obj = {
title:test.title,
fullTitle:test.fullTitle(),
duration:test.duration,
parentFullTitle:test.parent.fullTitle(),
- status:status
+ status:status,
+ path:test.parent.path
};
- if (status == "failed")
- obj.error = test.err; // Contains message, expected, actual, operator, stack
+ if (status == "failed") {
+ // Error objects don't serialize properly, so we copy attributes. Note
+ // that iterating over test.err skips name and message.
+ obj.error = {
+ name: test.err.name,
+ message: test.err.message,
+ // We could copy stack, fileName, and lineNumber here, but they're not
+ // available for AssertionErrors. If we had them reliably, we could
+ // easily display them as well.
+ };
+ }
return obj;
};
var createSuiteObject = function(suite) {
+ // We need to propagate the path down the suite tree
+ if (suite.parent)
+ suite.path = suite.parent.path;
+
var obj = {
title:suite.title,
- fullTitle:suite.fullTitle()
+ fullTitle:suite.fullTitle(),
+ path:suite.path
};
if (suite.parent)
obj.parentFullTitle = suite.parent.fullTitle();