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
Support symbols in array arg to createSpyObj() and expect().toHaveBeenCalled() etc #1250
Comments
This doesn't seem like something that add a whole lot of value to Jasmine, especially since we can't simply I'm going to close this. Thanks for using Jasmine! |
Do you mean for logging? You can toString() a symbol. I have no words for no support in IE being a reason not to implement! Maybe an example would help clarify, here is what I have to do to workround this issue: const handler = jasmine.createSpyObj('response', ['onText'])
functionUnderTest({
[onText]: (text) => handler.onText(text)
})
expect(handler.onText).toHaveBeenCalled(); with the const handler = jasmine.createSpyObj('response', [onText])
functionUnderTest(handler)
expect(handler[onText]).toHaveBeenCalled(); Maybe you would accept a PR for this? |
Unfortunately, the > Symbol('foo').toString()
"Symbol(foo)" This means that the Jasmine code would need to specifically know about Symbols in order to get the value Jasmine currently maintains support for IE 8 and up, while this doesn't mean we don't want any code that can't be run on IE8, it does mean we need to be careful about supporting features that completely don't exist in certain browsers. This is not currently something that we want to merge in. |
- What version are you using? 2.5.2
Symbols don't appear to work in these methods, I get the error:
The text was updated successfully, but these errors were encountered: