diff --git a/lib/templates/test-body-footer.html b/lib/templates/test-body-footer.html
index ba5c8c4e..8219f730 100644
--- a/lib/templates/test-body-footer.html
+++ b/lib/templates/test-body-footer.html
@@ -44,10 +44,16 @@
QUnit.done(function() {
sendCoverage();
});
+ } else if (typeof Mocha !== "undefined" && typeof after !== "undefined") {
+ after(function(done) {
+ sendCoverage(done);
+ });
+ } else {
+ console.warn('No testing framework found for ember-cli-code-coverage to integrate with.');
}
function handleCoverageResponse(xhr, callback) {
- var data = xhr.response;
+ var data = xhr.response || xhr.responseText;
// PhantomJS doesn't honor `responseType = 'json'`
if (typeof data === 'string') {