Unit tests and Angularjs

  • Svetka Sapelova
  • november 2014

Prosojnice

  • Unit tests in Angularjs
  • About me
  • Why unit tests?
  • What to test?
  • Unit test ar all about mocks
  • Angularjs is all about dependency injection
  • Dependency injection
  • What is dependency injection?
  • Dependency injection
  • Unit tests rely on the $injector
  • Testing controllers
  • Jasmine
  • How to mock promises
  • Reject/resolve the promise
  • Rule of thumb
  • Mocking dependencies
  • Angularjs $provide
  • Angularjs $provide
  • Use $provide
  • Ajax calls
  • A bit of theory
  • Ok, enough of theory
  • Ajax request
  • Similar to $httpBackend ngMock mocks $timeout, $interval
  • We are almost there
  • Directives
  • Directives are awesome
  • Simple directive
  • Testing directives
  • $compile
  • As long as we test ref to the html element, we can test things on it
  • Let's stop here
  • Tools
  • Karma, Jasmine
  • Where to learn more
  • Thank you!
Video všeč? Podprite nas! http://www.kiberpipa.org/sl/support/