jgrenon / angular-desktop-app

This is a simple application skeleton to create desktop application using AngularJS. This application is using node-webkit as our desktop host, bower to install client-side libraries as well as normal npm modules as supported by node-webkit.
MIT License
237 stars 57 forks source link

[Feature request] Testing framework integration #15

Open RubenCordeiro opened 10 years ago

RubenCordeiro commented 10 years ago

I've been trying to add unit, midway and e2e testing by configuring karma with the mocha.js extension. However, I'm in a dead end, configuring karma with requirejs is proving to be quite confusing to me, specially with the existing codebase.

I've managed to extract the requirejs configuration object to a separate file in order to avoid repetition for the test setup.

Has anyone setup a test framework with this seed? I would greatly appreciate the help.

jgrenon commented 10 years ago

I've been looking to setup unit and e2e tests since I got this seed started. I have a few ideas, I'll spend a few hours on this and hopefully we'll get some tests running in the next release.

RubenCordeiro commented 10 years ago

That's great. Here are a couple of ideas for the test setup that I've explored yesterday:

A gist with some of the referenced files: https://gist.github.com/SynapseR/37771cd5329b8106e036

I'm still trying to integrate karma into the project. If I succeed in doing so, I'll be sure to do a pull request and contribute to this great seed. Thanks for the great work you've been doing.

mikemilano commented 10 years ago

Should this work for testing components that have dependencies on node modules?

merqlove commented 10 years ago

This is good, but if i have lots of backend services, like rsa, database and so on, how can i test?:))) If you want to tell me: split it into backend and frontend, my answer no. I have no time for double work. But maybe this is nice idea, for fastest tests.

mikemilano commented 10 years ago

not sure how the solution fits into this project, but take a look at this thread. we got karma and protractor testing node-webkit just fine. https://github.com/rogerwang/node-webkit/issues/2229

merqlove commented 10 years ago

@mikemilano Thanks. Good idea. I will try it now also.