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

Only log console messages if there's a spec in progress. #124

Closed
wants to merge 1 commit into from
Closed

Only log console messages if there's a spec in progress. #124

wants to merge 1 commit into from

Conversation

mathie
Copy link

@mathie mathie commented Apr 10, 2013

Frameworks that logged to the console during initialization (eg EmberJS) were causing an error because logs[-1] was undefined. For bonus points, Ember helpfully swallowed this error in development and carried on, meaning that all the tests would mysteriously fail instead...

It might be useful to start logging these 'global' log messages too and communicating them back to the runner, but at least this gets my tests running again. :)

Frameworks that logged to the console during initialization
(eg EmberJS) were causing an error because logs[-1] was
undefined. For bonus points, Ember helpfully swallowed this
error in development and carried on, meaning that all the
tests would mysteriously fail instead...
@rud
Copy link
Contributor

rud commented Apr 10, 2013

This discards the startup messages if I understand it correct. Would it be possible to capture them instead and emit them when possible?

@swistak
Copy link
Contributor

swistak commented Apr 10, 2013

Yes the problem is -1 is used to log "global errors", and since recently terrors ARE comunicated back to user. Change was introduced by me here:

swistak@e431dcc

Your change would break that functionality.

@swistak
Copy link
Contributor

swistak commented Apr 10, 2013

Better solution would be probably to change:

logs = {}

to

logs = {"-1": []}

which should fix error with logs while not impairing global reporting functionality.

@netzpirat
Copy link
Contributor

I agree with @swistak, initialize the "global" logs array would be the best solution to fix the issue and not break global log reporting.

@swistak
Copy link
Contributor

swistak commented Apr 10, 2013

Sorry It's my fault should have written spec to test that functionality

@netzpirat netzpirat closed this in 2c03ffc Apr 10, 2013
@netzpirat
Copy link
Contributor

@mathie Can you please verify that the change solves your issue, so I can release a new version?

@mathie
Copy link
Author

mathie commented Apr 10, 2013

@netzpirat That's fixed it, thanks!

@mathie mathie deleted the discard-non-spec-console-messages branch April 10, 2013 16:43
@netzpirat
Copy link
Contributor

Version 1.15.1 is out that contains this fix. Thank you all!

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.

None yet

4 participants