ember-cli-code-coverage icon indicating copy to clipboard operation
ember-cli-code-coverage copied to clipboard

Global error: Uncaught TypeError: Cannot read property 'pct'

Open vignesh20794 opened this issue 4 years ago • 4 comments

getting this error when i ran 'COVERAGE=true ember test' have some screen shots stating the same

1.console error image

2: VScode terminal error image

3: debugged view image

the issue is because of stringification of the data object as in (debugged view screenshot) can u please look into it

ember-cli: 3.22.0 node: 10.16.3 ember-cli-code-coverage : 1.0.2 os: darwin x64

will be happy to help if needed

vignesh20794 avatar Nov 07 '20 11:11 vignesh20794

@vignesh20794 would you mind creating a repo to reproduce this issue? That would be very helpful to debug.

GCheung55 avatar Nov 07 '20 11:11 GCheung55

I run into the same issue on this Repo: https://github.com/opensource-challenge/opensource-challenge-client/tree/dependency-updates (branch dependency-updates) somehow the xhr.response is a string which would need to be parsed before accessing...

gobeli avatar Dec 02 '20 15:12 gobeli

I debugged this with someone earlier today, and in our case the issue was that some tests were not properly resetting the pretender instance so window.XMLHttpRequest was the FakeRequest object that Pretender installs, which does not respect the responseType property.

Specifically, someone was calling this.server = setupMirage() in their test, but never this.server.shutdown().

rwjblue avatar Jul 20 '21 21:07 rwjblue

😭 That explains so very much

kategengler avatar Jul 20 '21 22:07 kategengler