Development workflow of HTML/JavaScript application (web resource)

Dear fellowship,

About the setup: I’m building an HTML/JS repoting application for Dynamics 365 Sales as a web resource. The web resource is included in the site map of a model driven app and the user can select it using the navigation. The applcation consists of an HTML file, and a JS file which loads data using the Web API and then displays the data back to the user.

I use Visual Studio and the amazing spkl extension to deploy the web resources to a sandbox environment. This works great, but it’s getting very difficult to test the appication because the deployment is taking too long.

Is it possible to mock the Web API locally, or can I even connect to dynamics Web API from my machine without deploying?

What other tools are there to improve application development?

[mention:1d88bd060d714ae6900ee447096fb129:e9ed411860ed4f2ba0265705b8793d05] - thoughts?

[mention:41070ff665ff4373b482535f7550659b:e9ed411860ed4f2ba0265705b8793d05] & [mention:911c3a207f6f494698fc75e42bfb3a34:e9ed411860ed4f2ba0265705b8793d05] - There is a project out there for Unit Testing JavaScript projects for D365. If you have heard of the FakeXrmEasy project for testing C# (plugin/workflow extension) code, there is a newer complement project (but certainly not as mature) for mocking the D365 WebApi called FakeXrmEasyJS. The link to the project is: FakeXrmEasyJS.

There are also some examples of using it here: FakeXrmEasyJS Examples.

I haven’t used the JS version of FakeXrmEasy and there are some missing WebApi functions that have not been mocked yet but it may be helpful depending on what your custom code is doing.

Another option that I use all the time in PCF control development is to use Fiddler and create an AutoResponder for the control resources and redirect to my development directory locally. This is really the best way to debug/agile develop a PCF control. Might be an option for you as well.