chrisleishman/jsmockito — Issue #9: Feature Request: wrap verification error messages
Author: timezra
Created: 2012-02-26 00:04:56+00:00
State: open

Fantastic library! Thank you for contributing it to the community.

I am currently using JsMockito with JsTestRunner and have run into the following bug (in JsTestRunner):
http://code.google.com/p/js-test-driver/issues/detail?id=338
I am hoping that you would be willing to make a minor change to JsMockito to help in this situation. Namely, if you could change lines 132 and 163 from
throw description.get();
to
throw { message: description.get() };

I realize that JsTestRunner should have no problem handling thrown Strings, but there is an argument to be made for throwing Errors in JS as Objects with a "name" and "message" attribute.

Currently, I have made this change locally, and JsMockito and JsTestRunner work well together. Without this change, the two will not work for me. Hopefully, the JsTestRunner bug will be fixed soon, but in the meanwhile, it would be terrific if you could enhance JsMockito for this usage scenario.

Thanks again for a great tool!