Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[v4.2.0]"TypeError: Cannot read property 'length' of undefined" #222

Closed
1 task
killzoner opened this issue Aug 8, 2017 · 3 comments
Closed
1 task

[v4.2.0]"TypeError: Cannot read property 'length' of undefined" #222

killzoner opened this issue Aug 8, 2017 · 3 comments

Comments

@killzoner
Copy link
Contributor

killzoner commented Aug 8, 2017

Bug report

Check with "x":

  • [x ] I have this issue with the latest release of jasmine-spec-reporter
  • [x ] I have this issue with the latest release of jasmine
  • I can reproduce this issue with one of the examples

Current behavior
TypeError: Cannot read property 'length' of undefined
Expected behavior
Display nicely there is no error

Minimal reproduction of the problem with instructions
Protractor test with no error result

Hi, i'm having a "TypeError: Cannot read property 'length' of undefined" since v4.2.0 upgrade. Tested with 4.1.1 fine. I don't really have a repro right now but i managed to get it working with simple and no effect on the reporter behaviour (see pull request #223). Should probably investigate further to see why the property was set before and not now (maybe just an effect or refactoring occured with v4.2.0?).

Thanks!

@brandonaaskov
Copy link

brandonaaskov commented Aug 9, 2017

Thank you @killzoner for creating this issue. That made it very easy for me to fix my problem. We were seeing all our specs pass but our builds fail on our Jenkins box (AWS). I couldn't repro this locally, but rolling back to 4.1.1 solved it for me.

This same solution is already being used here in execution-display.ts.

@johnjbarton
Copy link
Contributor

I also encounter this; I think I caused this in #214.

I believe the problem is a change in jasmine versions: if jasmineDone sends RunDetails.failedExpectations as defined but empty we are good (new behavior), but if it is undefined then we failed. That explains why the yarn test works in pr #214 (jasmine 2.7.0). My use cases fail with jasmine-spec-reporter 4.20 + jasmine 2.4.1 but pass with jasmine 2.7.0.

I think the fix in #223 is correct.

@bcaudan bcaudan closed this as completed Aug 15, 2017
@bcaudan
Copy link
Owner

bcaudan commented Aug 15, 2017

Fix available in [email protected]

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

No branches or pull requests

4 participants