js testing angular testing - sinsunsan/archiref_wiki GitHub Wiki

Tuto

What is what

test runner : the engine that run the test

Test framework : Assertion library


How to write unit test


How to install a test environment


Test types

  • E2E test : test aa normal user, goint to the url, checking something exist....
  • Unit test : test a portion of code, verifying what we expect, actually suceed
  • black box testing : equal to E2E, we test the site on the users perspective, not trying to underestand what is behing

Inside a test spec

  • test : named test describe('angularjs homepage', function() {
  • assertion : named expectation of what the test should give it('should greet the named user', function() {

Angular modules used for unit testing

E2E Test (Test in a browser) as a user would do

Automate the way you do, when you are manually testing

http://angular.github.io/protractor/#/

Units test > Karma

http://karma-runner.github.io/0.12/index.html

Main

http://karma-runner.github.io

For compatibility problem with phantomjs see https://github.com/karma-runner/karma-phantomjs-launcher/issues/10