1

While, a google search gives the purpose for Karma and Protractor, I am keen to know as to what are the best practices when it comes to writing automated tests. Is it a recommended practice to write both Karma and Protractor tests? Is this an overkill on the project. How can one find the optimal balance?

Vojta
  • 23,061
  • 5
  • 49
  • 46
Aneesh
  • 579
  • 2
  • 5
  • 21

1 Answers1

0

It is not an overkill!

Only Protractor runs end-to-end (e2e) tests, i.e. your complete application, so this is the only reliable way to test the end result.

However, errors due to individual pieces of your code are hard to track with e2e tests. Also Protractor is slow and not suitable for running in background upon every source file edit, as Karma can do.

See my answer here for more detailed discussion of use cases, advantages and limitations of Karma and Protractor.

Community
  • 1
  • 1
Dmitri Zaitsev
  • 13,548
  • 11
  • 76
  • 110