Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 6 additions & 4 deletions lib/templates/test-body-footer.html
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,11 @@

if (REQUEST_ASYNC) {
request.responseType = 'json';
request.onload = function() {
handleCoverageResponse(this, callback);
}
request.onreadystatechange = function() {
if (request.readyState === 4) {
handleCoverageResponse(this, callback);
}
};
} else {
// The request is already done at this point, since it is synchronous
if (request.status === 200) {
Expand All @@ -47,7 +49,7 @@
}

function handleCoverageResponse(xhr, callback) {
var data = xhr.response;
var data = xhr.response || xhr.responseText;

// PhantomJS doesn't honor `responseType = 'json'`
if (typeof data === 'string') {
Expand Down