diff --git a/lib/test.js b/lib/test.js index 694285f..97dcd4b 100644 --- a/lib/test.js +++ b/lib/test.js @@ -13,11 +13,18 @@ function Test (result, suite) { } else { this.state = 'failed' } - if (result.diag && result.diag.source) { - var source = result.diag.source - this.fn = { - toString: function () { - return 'function(){' + source + '\n}' + if (result.diag) { + if (result.diag.source) { + var source = result.diag.source + this.fn = { + toString: function () { + return 'function(){' + source + '\n}' + } + } + } else { + this.context = { + title: 'diagnostic', + value: result.diag, } } }