-
-
Notifications
You must be signed in to change notification settings - Fork 771
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
Spying on objects with Symbol method names breaks assertion error messages #1640
Comments
Thank you for this very thorough bug report! Would you be up for creating a pull request to fix it? |
fongandrew
added a commit
to fongandrew/sinon
that referenced
this issue
Dec 30, 2017
Resolves sinonjs#1640 (assertion failure errors with "Cannot convert a Symbol value to a string")
2 tasks
Created! |
fongandrew
added a commit
to fongandrew/sinon
that referenced
this issue
Jan 7, 2018
Resolves sinonjs#1640 (assertion failure errors with "Cannot convert a Symbol value to a string")
fatso83
pushed a commit
that referenced
this issue
Jan 7, 2018
Resolves #1640 (assertion failure errors with "Cannot convert a Symbol value to a string")
Thank you for your contribution 👍 |
franck-romano
pushed a commit
to franck-romano/sinon
that referenced
this issue
Oct 1, 2019
Resolves sinonjs#1640 (assertion failure errors with "Cannot convert a Symbol value to a string")
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Code for formatting assertion error messages does not properly account for non-string method names (i.e. symbols). This may be a regression of #1002.
Reproduction Steps
Running this bit of code:
Results in this error:
Instead of the expected
AssertError: expected Symbol(my symbol) to be called with arguments
.Possible fix would be to explicitly type-cast symbol to string at
sinon/lib/sinon/spy.js
Line 379 in 5e131b3
return String(formatter.call(null, spyInstance, args))
)The text was updated successfully, but these errors were encountered: