-
-
Notifications
You must be signed in to change notification settings - Fork 35
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
Must can't handle ES6 (symbols) #36
Comments
Hey! Thanks for the catch! You're absolutely right. I fixed this quickly in a helper function (3fb59ad), but see stringifying in general could use a little refactoring. Please give that commit a try and if you give it a green light, I'll release a new patch bump with it. ;) Thanks! |
Thanks, I just tried that commit and it works fine for me, so I'm closing the issue. BTW, I really like the library. I migrated my hobby project from Chai to Must just a few days ago - I started looking for alternatives precisely because of the inconsistency of chai/should API (with regards to asserting on access vs call), and it's nice to know I'm not the only one seeing a problem there. As for Must, It can sometimes be a little rough on the edges, but shows great promise and it's already very usable. Keep up the good work :) |
Oh wait, I closed it too soon. Seems like there are still cases where symbols are reported as demand([Symbol("hello!")]).be.eql([Symbol("bye!")]) throws with the following message:
|
Ah, you stumbled upon exactly the case I hinted at with refactoring. :-) Thanks. I'll do that then after dinner today. ;-) Thanks for the love, too. Mind sharing what rough edges you noticed that I could perhaps get at with the same stick? :) |
Refactored stringifying to stringify both Symbols and also RegExps in nested objects. Please give it a try now and let me know. Thanks! |
While I was there, I threw in |
Hi there, and sorry for late reply. I tried the latest commit, and it works for the above cases, but now I discovered another one where it doesn't. When I use a
Edit: I think the problem with |
Using Must in Node.js 5.3, the following code:
correctly throws, but the error message is highly confusing:
Seems like Must uses a custom formatter for displaying values in situations like this, and it doesn't account for the possibility of encountering an object of a type unknown to it.
It should be fairly easy to at least add a fallback to
String(value)
for such cases in order to have forward compatibility. What do you think?The text was updated successfully, but these errors were encountered: