I'm stuck. I want to unit test my Java Scripts (Web Resources) in CRM 2016 but I'm not able to get this going. All the unit testing mocking/faking frameworks on the internet are for older versions of CRM. I'm yet to find a fully working unit testing framework for CRM 2016. There is FakeXRMEasy
but that has only been developed for Plugins, Workflows etc. Does anyone know how I can achieve this?
Asked
Active
Viewed 1,394 times
5

CuriousBeing
- 1,592
- 14
- 34
1 Answers
1
I have now successfully implemented Unit Testing of Java Scripts in my project by using QUnit
and a Faking/Mocking framework called XRMPage-Mock
. It was an easy setup after I understood it all. The link for the mocking framework is - https://github.com/ambek/XrmPage-Mock
Basically - Grab the XRMPage.js
, Attribute.js
, Control.js
files and put them in your Testing Solution. Get QUnit
, and all the relevant js
, css
and HTML
files.
The example on this link - https://github.com/ambek/XrmPage-Mock/tree/master/Example should help with writing the actual unit test.

CuriousBeing
- 1,592
- 14
- 34
-
Hi Max, Sorry, just seeing your question. There is a parallel repository to FakeXrmEasy for client side here (https://github.com/jordimontana82/fake-xrm-easy-js). Now the focus wasn't on the Xrm Page object as there were other projects on git for that. The focus of that one is gonna be mocking of web api calls. Hope you'll like the idea and it is very work in progress so would be awesome if you could give us some feedback? – Jordi Nov 11 '16 at 16:04