Search icon CANCEL
Subscription
0
Cart icon
Your Cart (0 item)
Close icon
You have no products in your basket yet
Save more on your purchases! discount-offer-chevron-icon
Savings automatically calculated. No voucher code required.
Arrow left icon
All Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Newsletter Hub
Free Learning
Arrow right icon
timer SALE ENDS IN
0 Days
:
00 Hours
:
00 Minutes
:
00 Seconds
Arrow up icon
GO TO TOP
Microsoft Dynamics 365 Extensions Cookbook

You're reading from   Microsoft Dynamics 365 Extensions Cookbook Add functionality to existing model elements, source code and finally package and deploy using DevOps

Arrow left icon
Product type Paperback
Published in Jun 2017
Publisher Packt
ISBN-13 9781786464170
Length 462 pages
Edition 1st Edition
Languages
Tools
Concepts
Arrow right icon
Toc

Table of Contents (19) Chapters Close

Title Page
Credits
Foreword
About the Author
About the Reviewer
www.PacktPub.com
Customer Feedback
Preface
1. No Code Extensions FREE CHAPTER 2. Client-Side Extensions 3. SDK Enterprise Capabilities 4. Server-Side Extensions 5. External Integration 6. Enhancing Your Code 7. Security 8. DevOps 9. Dynamics 365 Extensions 10. Architectural Views 11. Dynamics 365

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.

Getting ready

Unlike managed .NET code unit tests, JavaScript unit testing requires a bit of preparation to get up and running. There are a few parts to your setup: you will need...

lock icon The rest of the chapter is locked
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at $15.99/month. Cancel anytime
Visually different images