Closed tfoxy closed 6 years ago
@tfoxy, hi. thx for pr.
For what reason do you need this feature?
I wrote a library called chrome-promise, where instead of using callbacks for the methods, you can use promises. In that library, all apis are added by iterating every property.
A few months ago, an issue was opened saying that sinon-chrome
couldn't be used with the library: https://github.com/tfoxy/chrome-promise/issues/16 . In version 0.2.1 of sinon-chrome
, properties are enumerable and it works with chrome-promise
. After that version, there was a refactor where properties weren't enumerable anymore.
I think that having enumerable properties is better only because the chrome
API also has enumerable properties.
@tfoxy hi.
Sorry for delay. I've published new version on sinon-chrome@2.3.2 with your patch. P.S. check out my chrome-promise lib :) https://github.com/acvetkov/then-chrome
Thanks! Yeah, I had seen it before. Yours have sync methods, which is great. A week ago someone contacted me to tell me that Mozilla also has a library for this:
https://github.com/mozilla/webextension-polyfill
As soon as I fix something on my repo, I will release a new version and in the readme I will mention both libraries. It's been a long time since the last time I developed a chrome extension, so I'm not really interested in maintaining it in the long run. So it's better if I can give people some alternatives.
So it's better if I can give people some alternatives.
👍
When using the
chrome
API in the browser, the methods and props are enumerable:When using
sinon-chrome
, the methods and props are not enumerableThis PR creates methods, props and events as enumerable and configurable.