Book Image

Data Visualization with D3 and AngularJS

By : Erik Hanchett, Christoph Körner
Book Image

Data Visualization with D3 and AngularJS

By: Erik Hanchett, Christoph Körner

Overview of this book

Table of Contents (16 chapters)
Data Visualization with D3 and AngularJS
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
Index

Testing the directive


Testing is a very important and indispensable technique when writing good quality code. It makes sure that developers can test code repeatedly and automatically, for example, after the code was modified or when it runs in a different environment. Therefore, testing makes your code scalable, maintainable, and hopefully bug free.

Often, tests of a software are also seen as a documentation of the code because the tests show the proper usage of the code with all possible arguments and options. Moreover, this documentation is always up-to-date and executable, which is a huge advantage to static documentations.

In general, there exist multiple levels for software tests:

  • Unit tests: It is used to test single encapsulated components (functions)

  • Integration tests: It is used to test the integration of two or more components

  • System tests: It is used to test the entire application in the complete system stack

When developing frontend JavaScript code, it's common to test the first...