Unit testing your JavaScript

Nowadays, automated unit testing has become the norm on most projects. Unit testing is not only great at ensuring that your code is repeatedly and thoroughly tested, but it also provides a safety harness against future changes that might break your code. Furthermore, unit testing helps you improve code structure quality by building loosely coupled modules.

In this recipe, we will write a Visual Studio unit test for our Dynamics 365 JavaScript extension. More specifically, we will unit test the first JavaScript library we built in this chapter. We will check whether the conditions are correct and that the set value is called once on the postgraduatestartdate attribute. Given that the unit tests will run from Visual Studio with a fake Xrm.Page library, we won't need access to Dynamics 365.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.221.53.209