Skip to content

Fix issue with coverage report. - #262

Merged
rwjblue merged 1 commit into
masterfrom
fix-coverage-reporting
May 27, 2020
Merged

rwjblue merged 1 commit into
masterfrom
fix-coverage-reporting

Conversation

@rwjblue

@rwjblue rwjblue commented May 27, 2020

Copy link
Copy Markdown
Collaborator

Unfortunately, this codepath is not under test and the changes from #251 left it in an invalid state.

  • The REQUEST_ASYNC variable was no longer present, and therefore referencing it threw an error
  • The guard around xhr.responseText was no longer needed (we only ever get JSON, and xhr.response is already parsed properly for us)

We ultimately need to refactor to get this coverage reporting under test (plausibly an end-to-end acceptance test that confirms the expected JSON reporter output after running all the tests).

@rwjblue rwjblue added the bug label May 27, 2020
@rwjblue
rwjblue force-pushed the fix-coverage-reporting branch from 8dd0676 to 83887fb Compare May 27, 2020 20:03

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

Unfortunately, this codepath is not under test and the changes from a
prior PR left it in an invalid state.

* The REQUEST_ASYNC variable was no longer present, and therefore
  referencing it threw an error
* The guard around `xhr.responseText` was no longer needed (we only ever
  get `JSON`, and `xhr.response` is already parsed properly for us)

We ultimately need to refactor to get this coverage reporting under test
(plausibly an end-to-end acceptance test that confirms the expected JSON
reporter output after running all the tests).
@rwjblue
rwjblue force-pushed the fix-coverage-reporting branch from 83887fb to cc22041 Compare May 27, 2020 20:21
@rwjblue
rwjblue merged commit dde740c into master May 27, 2020
@rwjblue
rwjblue deleted the fix-coverage-reporting branch May 27, 2020 20:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants