fabien0102 / trelloblog

Use Trello as a database and back-office for a blogging system.
MIT License
9 stars 3 forks source link

Add fucking unit tests + coverage #12

Closed nicoespeon closed 10 years ago

nicoespeon commented 10 years ago

Some resource that you can find interesting Angular tutorial source: https://github.com/angular/angular-phonecat/tree/master/test/e2e Protractor repository: https://github.com/angular/protractor

fmonniot commented 10 years ago

Because I had spare time this morning...

nicoespeon commented 10 years ago

U mad ^_^

nicoespeon commented 10 years ago

@fmonniot > in fact, it would be nice to display the coverage too so we can track if we're missing something easily =)

fmonniot commented 10 years ago

I just have added end-to-end test BUT (yes, this is a big but) we have to dedicated a board for this one (or change tests each time we play with the current board...)

fmonniot commented 10 years ago

I have done all unit testing (except animation). For the end-to-end tests, I suggest to open a new issue, because it will require a little more preparation (dedicate board and mechanism to provide it in code)

As for animation, if someone wants to do it: http://www.yearofmoo.com/2013/05/enhanced-animations-in-angularjs.html#testing-animations

nicoespeon commented 10 years ago

THX @fmonniot :+1:

I'll handle the animations testing FTW \o/ And I create the end-to-end tests on the fly. That would be for another release though.

nicoespeon commented 10 years ago

@fmonniot > hmmm it seems that testing animations won't be easy because of Jasmine terrific way to handle asynchronous unit tests.

Still, I'll do my best to find a solution ^_^

fmonniot commented 10 years ago

OK. I'll look if web can use mocha/chai for testing if you want. It should be possible.

nicoespeon commented 10 years ago

Yep, that's what I thought. If the switch is easy, it seems to be much powerful for that kind of tests =)

nicoespeon commented 10 years ago

Well, I didn't managed to set up unit tests for animations.

There is no tutorial I found over the Internet which explains how to properly test animations with Angular 1.2 and jasmine 1.3. Plus, every tutorial / newsletter I found from Angular doesn't test animations.

For now the current coverage will be enough. We will test animations later I guess (maybe using mocha instead of jasmine?). I'll close this issue for now =)