Closed MeirionHughes closed 7 years ago
I'm creating an electron app using this project as skeleton. I can help you by configuring a test runner and writing some tests.
Since you are quite acquainted with aurelia, I was wondering:
Adding in what you get by default by the aurelia-cli would probably be the best first step. Location wise, I'd prefer a seperate /spec
folder. I was hoping to have the spec tests operate on the end-product (electron), but that might not be feasible.
To be fair, I've not done spec tests in the browser yet, only stuff with server-side (yasmine); so I'll defer to you if you'd like to add something.
A quick glance to spectron seems to indicate that it's the "blackest boxed testing" ever 😬 , meaning the app needs to be packaged in order for test to be executed. I'm going to write some jasmine white box tests, only for "tutorial" purposes, but any class that uses electron's API might not be easily testable (electron object should be mocked). To execute spectron's test, a script will be execute through npm (configured in package.json) that will package, run the test and may delete the packaged app later.
This way, the application the developer will have a template to write white box test, and black box tests.
Okay fair enough; testing the app components alone should be good enough.
I've pushed the unit testing structure with a working unit test; still lacking spectron's test nor used any class that imports electron.
I will be working on those two from now on.
http://electron.atom.io/spectron/