links (jsFiddle):
- scripting language
- [modular coding] (https://jsfiddle.net/ronapelbaum/y959gzeg/)
jasmine intro
- [test a function] (https://jsfiddle.net/ronapelbaum/u6dLzpmc/)
- [test an object] (https://jsfiddle.net/ronapelbaum/32medvkz/)
- [testable code] (https://jsfiddle.net/ronapelbaum/tnwae3v6/)
- [spy on] (https://jsfiddle.net/ronapelbaum/8Lsbps4u/)
- [spyOn and return] (https://jsfiddle.net/ronapelbaum/gx4Lwb48/)
- [real unit test] (https://jsfiddle.net/ronapelbaum/utcs96km/)
- [callFake + callbacks] (https://jsfiddle.net/ronapelbaum/ex41dsec/)
angular + jasmine
- [testing services] (https://jsfiddle.net/ronapelbaum/2fb53hbr/)
- [inject() + spyOn()] (https://jsfiddle.net/ronapelbaum/2fb53hbr/1)
- [$provide() + createSpyObj()] (https://jsfiddle.net/ronapelbaum/2fb53hbr/2)
- [testing controllers] (https://jsfiddle.net/ronapelbaum/4hbb79rg/)
- [controller as] (https://jsfiddle.net/ronapelbaum/uneb5gu5/)
- [$scope (state on scope)] (https://jsfiddle.net/ronapelbaum/z8g8mk3h/)
- [testing directives] (https://jsfiddle.net/ronapelbaum/xgojw58j/)
- [scope] (https://jsfiddle.net/ronapelbaum/qorkcnnL/)
common angular patterns
- [$http] (https://jsfiddle.net/ronapelbaum/bhLmdkms/)
- [$timeout] (https://jsfiddle.net/ronapelbaum/9mt79yaf/)
- [events] (https://jsfiddle.net/ronapelbaum/9pogcprf/)
- [promise] (https://jsfiddle.net/ronapelbaum/nd8t4ef0/)