ThorstenHans / ngx-electron

A simple Angular wrapper for electron's Renderer API
MIT License
429 stars 86 forks source link

Add FakeElectronService for testing #39

Closed ottosson closed 5 years ago

ottosson commented 5 years ago

Wouldn't it be a good thing to add the FakeElectronService, from the gist hinted at in #20, to the module for easier testing?

ThorstenHans commented 5 years ago

Hmm, 🤔 providing it in the library may work for that particular scenario buy I think the fake heavily depends on the requirement you've to meet... I see potentially ending up in providing fake impl. for every electron API 😀

Basically, that was exactly the reason why I added the abstract base class.

However, if you come up with something generic in PR, I would be really thankful 👍

ottosson commented 5 years ago

Just implementing a small part of this for my own needs I couldn't really figure out something generic. And as you say it would be too much work implementing mock functionality for every Electron feature 🙄