app/assets/javascripts/konacha/parent.js in konacha-3.2.1 vs app/assets/javascripts/konacha/parent.js in konacha-3.2.2

- old
+ new

@@ -2,9 +2,26 @@ // The iframe order is undefined, so we make it predictable. mocha.suite.suites.sort(function (a, b) { return a.path.localeCompare(b.path); }); + var originalTestUrl = Mocha.reporters.HTML.prototype.testURL; + + Mocha.reporters.HTML.prototype.suiteURL = function(suite) { + var specFilePath, + grepString = originalTestUrl(suite), + currentSuite = suite; + + while (!(specFilePath = currentSuite.path)) { + currentSuite = currentSuite.parent + } + + specFilePath = /([^\.]*)/.exec(specFilePath)[1]; + return location.protocol+'//'+location.host+'/'+specFilePath+grepString; + }; + + Mocha.reporters.HTML.prototype.testURL = Mocha.reporters.HTML.prototype.suiteURL; + // Check that all iframes loaded successfully. var iframes = document.getElementsByTagName('iframe'); for (var i = 0; i < iframes.length; ++i) { if (!iframes[i].contentWindow.mocha) { (function (path) {