http://creativecommons.org/licenses/by-nc-sa/3.0/
These slides are licensed using:
Testing JavaScript
Kuba Waliński
Kuba Waliński
kubawalinski@gmail.com
@kubawalinski
github.com/kubawalinski
blog.kubawalinski.com
JavaScript a few years ago
JavaScript today
e2e acceptance tests
usually created by QA staff
fragile
quite slow
still better than a 100 page long acceptance document
Linting
JSLint, JSHint, ESLint
Able to catch some problems early
Choose
your own
rules
Why unit tests?
Unit testing is boring?
"Unit testing is like sex - if it's not fun, you're doing it wrong"
Tightening the feedback loop
after UAT, release - users
after finishing a feature - qa staff
after each commit/push -
???
after each code change -
???
Tests first?
or code first?
Explore the unknown
Validation of your hypotheses
Tests as documentation
always up to date
Don't overdo it
chasing coverage considered harmful
Make it easy to test
and hard to be wrong
automate all the things?
treat warnings as errors
Tools don't matter
just start doing it
Demo time :)
Useful links
http://bit.ly/wec2015-testjs
The spirit of testing
Idiot-proofing your JS code
http://eslint.org
http://karma-runner.github.io
http://jasmine.github.io
http://gruntjs.com
http://gulpjs.com
http://phantomjs.org
http://jspm.io
Why unit tests?
tighter feedback loop
explore the unknown
validate your hypotheses
always up-to-date documentation
reassure yourself that it all works
Seriously, you should start testing that JS code
Thanks!
Made with Slides.com