Synyzapo

  • Place your test code into the spec directory
  • Place your application code into the src directory
  • Modern software development is done with unit tests.
  • The Jasmine framework is a very popular JavaScript testing framework and one that works very well when testing Angular code.
  • Erase everything in src and spec directories


Because of JavaScript dynamic type nature, coding in JavaScript can be an unconstrained experience. That’s why testing your JavaScript code before shipping it off to our users is very important.
Modern software development is done with unit tests.


@synyzapo: JavaScript Testing with Jasmine: #angularjs #javascript #frontend

Posted on January 18, 2017

Because of JavaScript dynamic type nature, coding in JavaScript can be an unconstrained experience. That’s why testing your JavaScript code before shipping it off to our users is very important. Modern software development is done with unit tests.

Unit testing is independent checking for proper operation of the smallest testable part of an application. Unit testing must be independent, smallest testable, repeatable.

Sometimes we want to test a small unit of code without it’s dependencies and this process is named mocking. Mocking is a technique where dependency and its behavior is imitated or otherwise just known faked. Mocking can be done by the developer or a mocking library.

You could create your unit tests without any help from othe framework, but it’s easier to use a testing framework that comes with a bunch of tools to help you with setup of your tests. The Jasmine framework is a very popular JavaScript testing framework and one that works very well when testing Angular code.

Synyzapo

You might also like More from author

Comments are closed, but trackbacks and pingbacks are open.