Skip to content
This repository has been archived by the owner on Feb 26, 2024. It is now read-only.

ZoneTask.toString can return a number, which causes problems in Jasmine #1153

Closed
fr0 opened this issue Oct 31, 2018 · 5 comments · Fixed by #1166
Closed

ZoneTask.toString can return a number, which causes problems in Jasmine #1153

fr0 opened this issue Oct 31, 2018 · 5 comments · Fixed by #1166

Comments

@fr0
Copy link

fr0 commented Oct 31, 2018

If a karma/jasmine test fails due to an unhandled promise rejection, Jasmine's PrettyPrinter class throws an exception due to the ZoneTask.toString function not returning a string.

See: jasmine/jasmine#1575

@JiaLiPassion
Copy link
Collaborator

@fr0, thanks, is there any reproduce repo?

@fr0
Copy link
Author

fr0 commented Nov 1, 2018

I have not been able to reproduce it outside of my private repo, but I will keep trying. Thanks!

@jonatino
Copy link

Also seeing this issue in jasmine.

@jonatino
Copy link

jonatino commented Nov 19, 2018

@JiaLiPassion @fr0 looks like the issue is coming from here (ZoneTask)

    public toString() {
      if (this.data && typeof this.data.handleId !== 'undefined') {
        return this.data.handleId;
      } else {
        return Object.prototype.toString.call(this);
      }
    }

It will return the TaskData.handleId which is a number. Returning a number doesn't make sense in a toString() call.

@JiaLiPassion
Copy link
Collaborator

@jonatino, thanks! I will fix this one.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants