Are you writing enough tests for your applications? We thought not! Ryan Roemer of Formidable Labs and author of the new book, "Backbone Testing.js", will help us learn how to test your JavaScript applications in a 3 hour workshop at Redfin's beautiful downtown headquarters.
The workshop will be a mixture of lecture and hands on lessons. With the help of our fabulous mentors you'll learn how to craft a frontend test infrastructure using Mocha, Chai, Sinon.JS and PhantomJS.
15. WE WILL LEARN HOW TO
Hook frontend JS to tests
Write assertions against behavior
Fake application behavior
Run and verify the tests
16. THINGS WE'RE NOT
GOING TO COVER
TDD / BDD
Application development
Functional testing
Performance testing
17. CODING TIME
We're going to say hello:
"SeattleJS" ➞ "Hello SeattleJS!"
And camel case strings:
"fun-test-time" ➞ "funTestTime"
18. SET UP YOUR PROJECT
#Cp teseeo apiain
oy h kltn plcto.
$c - seeo M_P_AE
p r kltn YAPNM
19. PROJECT STRUCTURE
Using with the "skeleton" application.
M_P_AE
YAPNM/
j/
s
ap
p/
hloj
el.s
cmlj
ae.s
lb
i/
ca.s
hij
mcaj
oh.s
mcacs
oh.s
snnj
io.s
idxhm
ne.tl
21. CAMEL CASE
skeleton/js/app/camel.js
/ Cmlcs asrn.
/ ae ae
tig
vrcml=fnto (a){
a ae
ucin vl
/ Upraetefrtcaatratrads
/ pecs h is hrce fe
a
rtr vlrpae/()g fnto (,fr
eun a.elc(-./, ucin m i
rtr frttUprae)
eun is.opeCs(;
};
)
}
;
28. TEST.HTML
<- Ts Stp->
!- et eu <cit
srp>
/ Stu Ca adMca
/ e p hi n oh.
wno.xet=ca.xet
idwepc
hiepc;
mcastp"d";
oh.eu(bd)
/ Rntsso wno la.
/ u et n idw od
wno.nod=fnto ( {
idwola
ucin )
mcarn)
oh.u(;
<srp>
/cit
29. TEST.HTML
<- Tss ->
!- et. <- ..se srp icue g hr ..
!- . pc cit nlds o ee .
<ha>
/ed
<oy
bd>
<i i=mca>/i>
dv d"oh"<dv
<bd>
/oy
<hm>
/tl
example/test-empty.html