Does anyone use some unit-testing or e2e-testing tool for their app?
I am also looking for something like this.
When I’ve experimented with atom-shell, I just use Jasmine like in Atom itself.
How to test an Electron app?
I looked at the spec folder of atom-shell to get the insipiration. Basically you create another atom-shell app in which all your testing actually happens.
can you elaborate a bit more on how you managed to get your testing environment up and running?
There is a documentation using WebDriver.
I would like to know if someone knows a good way to unit-test and/or e2e-test an Electron app. Is there a tutorial somewhere?
I refered to this topic but I didn’t find it very helpful.
There’s https://github.com/jprichardson/electron-mocha that entices me but honestly there’s so little documentation about how to use it. There’s very few tutorials on writing mocha tests that apply themselves to electron and a beginner like me is having a lot of trouble getting started with testing electron due to the unique framework.
For anyone interested, I have documented about my approach here: http://blogs.nnn.ninja.np/fb-messenger/2015/12/05/Learning-js-technologies-part22/
Just grab the code from this url: https://github.com/nripendra/fb-messenger/tree/develop/tests
You’ll have to change runner/index.html file to suit your need… I have all the tests in single file, so doing just
works for me.
For most of scenario people may want to use something that can grab desired files using glob patterns.
Since this post is allowing just 2 links, I’m not linking the original author, but you’ll find the link in my post. The original project to use this approach is rhysd/Shiba in github.