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

HTML/DOC reporter regressions as a result of #2037 #2067

Closed
danielstjules opened this issue Jan 26, 2016 · 2 comments
Closed

HTML/DOC reporter regressions as a result of #2037 #2067

danielstjules opened this issue Jan 26, 2016 · 2 comments

Comments

@danielstjules
Copy link
Contributor

#2037

As a result of that PR, the browser & doc reporters cannot handle showing function bodies when exceptions are thrown async, outside of the duration of the originating suite (after the suite has ended). They'll result in: Uncaught TypeError: Cannot read property 'toString' of undefined

The line in question:

var pre = fragment('<pre><code>%e</code></pre>', utils.clean(test.fn.toString()));

Rather than revert #2037, I propose caching the function body strings, which should still be light.

@francisco-sanchez-molina

Hi @danielstjules @boneskull! After test.fn.toString() to test.body change, when "before" throw Error mocha explode in mocha.js:5980 Uncaught TypeError: Cannot read property 'replace' of undefined

2.4.4 version http://jsfiddle.net/38v388kw/

2.3.4 version http://jsfiddle.net/joes4L1q/

@asadsahi
Copy link

any fix for this? having same issue.

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

3 participants