TDD KnockoutJS
www.kylehodgson.com
@kylehodgson
Legacy Code
Snake Charmer
Test Driven Development
● Red
● Green
● Refactor
Great!
But what about your
JavaScript?
KnockoutJS
KnockoutJS
Jasmine Spec
var self = this;
var Fruit = function() {
this.name = ko.observable();
}
var myFruit = new Fruit();
myFruit.name="Mango";
wrong!
myFruit.name="Mango";
right!
myFruit.name("Mango");
var Fruit = function() {
this.name = ko.observable();
}
var myFruit = new Fruit();
myFruit.name("Mango");
console.log(myFr...
wrong!
console.log(myFruit.name);
right!
console.log(myFruit.name());
KarmaJS
c:projectsToDontList> more toDontEnv.bat
set HOME=c:userskhodgson
set PATH=%PATH%;c:nuget
set CHROME_BIN=%HOME%AppDataLoca...
Epic User Story
As a busy executive,
I'd like to keep track of
things that aren't important,
So that I can make sure that
...
Live Code Section
ToDontList
Thanks!
https://github.com/kylehodgson/ToDontList
http://www.kylehodgson.com
@kylehodgson
kyle.hodgson@gmail.com
TDD with KnockoutJS
TDD with KnockoutJS
TDD with KnockoutJS
TDD with KnockoutJS
Upcoming SlideShare
Loading in...5
×

TDD with KnockoutJS

186

Published on

Published in: Software
1 Comment
0 Likes
Statistics
Notes
  • Here's the live coding demo: http://vimeo.com/user18611322/knockout-karma-tdd
       Reply 
    Are you sure you want to  Yes  No
    Your message goes here
  • Be the first to like this

No Downloads
Views
Total Views
186
On Slideshare
0
From Embeds
0
Number of Embeds
2
Actions
Shares
0
Downloads
6
Comments
1
Likes
0
Embeds 0
No embeds

No notes for slide

TDD with KnockoutJS

  1. 1. TDD KnockoutJS www.kylehodgson.com @kylehodgson
  2. 2. Legacy Code
  3. 3. Snake Charmer
  4. 4. Test Driven Development ● Red ● Green ● Refactor
  5. 5. Great! But what about your JavaScript?
  6. 6. KnockoutJS
  7. 7. KnockoutJS
  8. 8. Jasmine Spec
  9. 9. var self = this;
  10. 10. var Fruit = function() { this.name = ko.observable(); } var myFruit = new Fruit(); myFruit.name="Mango";
  11. 11. wrong! myFruit.name="Mango"; right! myFruit.name("Mango");
  12. 12. var Fruit = function() { this.name = ko.observable(); } var myFruit = new Fruit(); myFruit.name("Mango"); console.log(myFruit.name);
  13. 13. wrong! console.log(myFruit.name); right! console.log(myFruit.name());
  14. 14. KarmaJS
  15. 15. c:projectsToDontList> more toDontEnv.bat set HOME=c:userskhodgson set PATH=%PATH%;c:nuget set CHROME_BIN=%HOME%AppDataLocalGoogleChromeApplicationchrome. exe set IE_BIN=C:Program FilesInternet Exploreriexplore.exe set PHANTOMJS_BIN=%HOME%AppDataRoamingnpmphantomjs.cmd set FIREFOX_BIN=C:Program Files (x86)Mozilla Firefoxfirefox.exe
  16. 16. Epic User Story As a busy executive, I'd like to keep track of things that aren't important, So that I can make sure that I don't do them.
  17. 17. Live Code Section ToDontList
  18. 18. Thanks! https://github.com/kylehodgson/ToDontList http://www.kylehodgson.com @kylehodgson kyle.hodgson@gmail.com
  1. A particular slide catching your eye?

    Clipping is a handy way to collect important slides you want to go back to later.

×