Testing environment
Closed this issue · 7 comments
Hi,
thanks for putting this together, I found it quite helpful.
Any chance of adding a very minimal test-environment for the generated app? I know, it requires some opinionated choice, but I believe it'd be good to have a working testing environment to start with (e.g. Grunt/Glue/Npm test task, example tests for both the renderer and the main process, etc..).
Thanks.
How would you imagine testing the app? Like what kind of testing would you like specifically?
I was thinking of basic unit tests running inside Electron. Possibly something that supports test-on-save, but that could probably be an afterthought. I think it should be as simple as possible, and, as said, support testing both main-process modules and in-browser code.
Yeah, I got that, but what would it test?
Sorry, not sure I understand what you're asking (and sorry if I'm giving the wrong answer). What I mean is that, when developing an app within electron, you can't just unit-test your modules with e.g. karma, since electron architecture provides feature not generally available in a browser (namely, node bindings).
Assume that I write a twitter client for mac, I'll probably write a module to wrap the twitter APIs, one for auth, one for caching, etc..
I'd like to be able to unit-test each of this module in isolation and in the context execution of Electron.
The idea is: how would you set-up a testing environment for this? I suppose you should write a very simple (separate) Electron app which sets up jasmine/mocha/whatever and then run this app to test your code. Now, setting up this environment shouldn't be very hard, but it's the sort of thing that become very handy if provided with the boilerplate (or in the yo generator).
Hope this as clarified my request a bit, sorry again if I'm talking nonsense.
That makes it totally clear. Thanks :)
I don't have an answer for you right now, but this is something I would need too, so I'll try to come up with something.
Maybe we could add https://github.com/jprichardson/electron-mocha?
Closing as Spectron is not well-maintained: electron-userland/spectron#359 Will do this if that ever changes.