Skip to content

Fix hang when running in PhantomJS. - #43

Merged
rwjblue merged 1 commit into
ember-cli-code-coverage:masterfrom
dfreeman:phantom-hang
Sep 19, 2016
Merged

rwjblue merged 1 commit into
ember-cli-code-coverage:masterfrom
dfreeman:phantom-hang

Conversation

@dfreeman

@dfreeman dfreeman commented Sep 19, 2016 •

Copy link
Copy Markdown
Contributor

In trying to diagnose why tests hang when trying to report coverage with PhantomJS, I realized this.response was coming back as a string rather than a parsed object after posting the coverage information.

It turns out (as far as I can tell), Phantom just doesn't honor xhr.responseType = 'json', and if you read it back, you just get ''. To convince myself I wasn't going crazy, I captured the result of loading this page in Phantom 2.1, and it looks like this:
result

Adding an explicit JSON.parse avoids the early return so that the Testem callback gets invoked and everything cleans up correctly.

I'm not sure how (or whether) to test this; any input on that is welcome. Thanks!

@rwjblue

rwjblue commented Sep 19, 2016

Copy link
Copy Markdown
Collaborator

LOLOLOL

@rwjblue
rwjblue merged commit d15322f into ember-cli-code-coverage:master Sep 19, 2016
@kellyselden

Copy link
Copy Markdown
Collaborator

expert level debugging right there.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants