diff --git a/lib/templates/test-body-footer.html b/lib/templates/test-body-footer.html
index 39b8c7f3..d9c61631 100644
--- a/lib/templates/test-body-footer.html
+++ b/lib/templates/test-body-footer.html
@@ -12,7 +12,7 @@
var data = JSON.stringify(coverageData || {});
var request = new XMLHttpRequest();
- request.open('POST', '/write-coverage', REQUEST_ASYNC);
+ request.open('POST', '/write-coverage');
request.setRequestHeader('Content-Type', 'application/json; charset=utf-8');
request.responseType = 'json';
request.send(data);
@@ -43,13 +43,6 @@
function handleCoverageResponse(xhr, callback) {
var data = xhr.response;
- // avoid InvalidStateError by incorrectly accessing xhr.responseText property
- if (!data && (xhr.responseType === '' || xhr.responseType === 'text')) {
- data = xhr.responseText;
- } else {
- throw new Error(`ember-cli-code-coverage: invalid data ${JSON.stringify(data)} received for responseType ${xhr.responseType}`);
- }
-
if (!data) {
return;
}
diff --git a/test/unit/index-test.js b/test/unit/index-test.js
index 1f5c61d9..1c125069 100644
--- a/test/unit/index-test.js
+++ b/test/unit/index-test.js
@@ -59,7 +59,7 @@ describe('index.js', function() {
});
it('includes the project name in the template for test-body-footer', function() {
- expect(Index.contentFor('test-body-footer')).to.match(/`["some/module", "some/other/module"`]/);
+ expect(Index.contentFor('test-body-footer')).to.include(`["some/module","some/other/module"]`);
});
});
});
@@ -544,4 +544,4 @@ describe('index.js', function() {
});
-});
\ No newline at end of file
+});