strongloop / strong-remoting

Communicate between objects in servers, mobile apps, and other servers.
www.strongloop.com
Other
105 stars 93 forks source link

stringify mockWrapper so we can generate coverage #243

Closed rmg closed 9 years ago

rmg commented 9 years ago

This has to be done because when we run the tests with coverage the function body gets mangled by instrumentation and the string replacements fail horribly. The end result is the generated function ends up not even being valid JavaScript and the tests then fail for obvious reasons.

ritch commented 9 years ago

LGTM

bajtos commented 9 years ago

Thanks @rmg for fixing this issue.

I wish we could keep using toString, so that the function body can be run through the linter and we can use IDE auto-completion while changing its code, but I understand that's not feasible with our CI setup.

rmg commented 9 years ago

@bajtos there are some alternatives that would allow the function to remain a function: