Skip to content
Merged
Show file tree
Hide file tree
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
9 changes: 1 addition & 8 deletions lib/templates/test-body-footer.html
Original file line number Diff line number Diff line change
Expand Up @@ -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');

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

XHR's .open method defaults to async if not given a value of false for the 3rd argument.

https://developer.mozilla.org/en-US/docs/Web/API/XMLHttpRequest/open

request.setRequestHeader('Content-Type', 'application/json; charset=utf-8');
request.responseType = 'json';
request.send(data);
Expand Down Expand Up @@ -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;
}
Expand Down
4 changes: 2 additions & 2 deletions test/unit/index-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -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"]`);
});
});
});
Expand Down Expand Up @@ -544,4 +544,4 @@ describe('index.js', function() {

});

});
});