Of Angular and Testing

mohukh

mohuk

Development is generally ...

Testing is  ...

Agenda

Path to ace testing Angular JS apps

Angular JS

Jasmine

Karma

Protractor

Why test my code? It works

  • Improves developer confidence
  • Enhances code quality
  • Easier refactoring and introducing changes
  • Speeds up shipment cycles
  • Essential when deploying through CI

In general ...

Why test angular js apps

  • @extends "benefits of testing code in general"
  • Encourages modular coding patterns
  • Speeds up testing on different environments and browsers

 

 

 

couldn't come up with more, its 12:51 in the night !

How

Jasmine

Karma

Protractor

Jasmine

Karma

Protractor

testing javascript behavior (BDD)

test runner 

e2e testing with Jasmine and Selenium WD

Coming soon !

roadmap

Controllers

Services

Directives

Filters

Understand the application under test

Build a testing environment

Testing thought process

Analyze the code paths

Setup

Define expectations

Execute

Update

Let's test !

What practices do I follow

  • Analyze code paths which need to be tested (100% coverage is a myth)
  • Use generators to keep things easy and consistent
  • Carefully prepare test data, DRY is not for testing, test data should be verbose
  • Don't know/care about TDD vs BDD vs Unit Testing theories
    • Write empty test stubs on the go and populate them later
  • Make testing a part of the build process 
  • If you do the above you keep updating --force (achievement unlocked!)

Test like Shahid bhai

Of Angular and Testing

By Mohammad Umair Khan

Of Angular and Testing

Introduction to testing Angular JS applications with Jasmine on Karma

  • 1,417