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

Cannot convert a Symbol value to a string #300

Closed
jasonkarns opened this issue Nov 17, 2017 · 0 comments · Fixed by #301
Closed

Cannot convert a Symbol value to a string #300

jasonkarns opened this issue Nov 17, 2017 · 0 comments · Fixed by #301
Labels

Comments

@jasonkarns
Copy link
Member

When attempting to console log an object that has stubbed methods:

message: Cannot convert a Symbol value to a string
  stacktrace: TypeError: Cannot convert a Symbol value to a string
    at Object.get (/Users/jasonkarns/Projects/shutterstock/little-sister/node_modules/testdouble/lib/object.js:61:67)
    at formatValue (util.js:420:38)
    at formatProperty (util.js:828:11)
    at formatObject (util.js:644:17)
    at formatValue (util.js:606:18)
    at inspect (util.js:321:10)
    at format (util.js:188:12)
    at Console.log (console.js:127:21)
    at LittleSister.parseEventValue (/Users/jasonkarns/Projects/shutterstock/little-sister/src/index.js:84:11)
    at propsFromDataTrack (/Users/jasonkarns/Projects/shutterstock/little-sister/src/index.js:78:17)

I believe this is related to (or a dupe of #124)

Investigation:

The error traces to: https://github.com/testdouble/testdouble.js/blob/v3.2.6/src/object.js#L38
which compiles as: https://github.com/testdouble/testdouble.js/blob/v3.2.6/dist/testdouble.js#L10675

According to nodejs/node#927 (comment), implicit string conversion is not allowed on symbols.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant