Skip to content
This repository has been archived by the owner on May 29, 2019. It is now read-only.

The Mocha vs mocha test failed, here is a more robust handling of the pr... #19

Merged
merged 3 commits into from
Sep 28, 2012
Merged

Conversation

rohni
Copy link
Contributor

@rohni rohni commented Sep 24, 2012

Tried using grunt-mocha and ran into a problem where it failed because there was no test to see whether Mocha was defined, and so it failed.

This fixes the problem. I tried a try..catch solution initially, but it was pretty ugly, although I don't think this is much better.

The whitespace changes seem to have been made by my editor, but it is a bit cleaner this way.

Thanks, and hope this is helpful.

Rohan

@kmiyashiro
Copy link
Owner

Oh, I see. Instead of all those if statements, could you just change the original test to Mocha and mocha to window.Mocha and window.mocha instead? Silly mistake.

@rohni
Copy link
Contributor Author

rohni commented Sep 26, 2012

Okay, I have made the changes and pushed, they should be waiting in the branch.

@kmiyashiro
Copy link
Owner

Hmm, don't see it in your branch, are you sure you pushed?

@rohni
Copy link
Contributor Author

rohni commented Sep 27, 2012

Oops, how embarrassing. It is now pushed.

@rohni
Copy link
Contributor Author

rohni commented Sep 28, 2012

Yeah, that was another issue. The intermediary check is definitely needed, will adjust the code. Actually that was my first attempt to get it working, which failed because of the undefined Mocha. The window. solved this, of course, but not the second.

I am assuming from what i see above, and that GruntReporter has no callback, that synchronous code is safe here.

…ts all the ugly typeof something !== 'undefined'.
@kmiyashiro
Copy link
Owner

Thanks!

kmiyashiro added a commit that referenced this pull request Sep 28, 2012
The Mocha vs mocha test failed, here is a more robust handling of the pr...
@kmiyashiro kmiyashiro merged commit 276acef into kmiyashiro:master Sep 28, 2012
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 this pull request may close these issues.

None yet

2 participants