ElioStruyf GitHub Star | M365 Development, Developer Technologies MVP | Google Developer Expert Azure | Microsoft 365 | Visual Studio Code | End-to-End Testing

Along with acting as VP of BIWUG (Belgian Information Worker User Group), Elio is an independent contractor for his own consulting company, Struyf Consulting.

Exclude your mock data and other modules from your production bundle in SPFx

When creating solutions with SharePoint Framework, in many cases you might want to call some API endpoints. Like for instance the SharePoint rest API or Microsoft Graph. To speed up your development, testing and overcome issues like CORS (cross-origin resource sharing). You might have implemented some mock data objects or mock services which return static data.

Read more

How to debug your SharePoint Framework unit-tests

The reason you probably read this post is that you already wrote some unit tests for SharePoint Framework projects and you stumble upon a problem and want to debug one of your unit-tests. Apparently, the process is not so easy as linking your debugger to the gulp test task. There is a bit more plumbing involved to get a good experience.

Read more

Extend Karma to get better code coverage and test reports for your SharePoint Framework solutions

In one of the previous posts I showed that since SharePoint Framework version 1.2.0, code coverage reports were added. When you run the gulp test task, it will execute the tests, and generate a code coverage report which you can find under the temp/coverage/js project folder. Read more about this in the following article: SharePoint Framework code coverage reports for unit-tests

Read more

How to load scripts that are required for your item display template rendering

Based on the number of questions I receive in my mailbox, I can see that display templates are not yet forgotten. A long time ago, I wrote about how to correctly include scripts into your display templates. Read more: Correctly including scripts into your display templates The main issue when using the default functions (for example $includeScript) to include scripts into your templates, is that they are loading your scripts asynchronously.

Read more

Using base64 encoded images as the web part icon in SPFx

Web part icons help you to distinguish your web part between all the others. Show image Modern client-side web parts SharePoint Framework provides use two options at this moment of specifying an icon: Office UI Fabric font icons (officeFabricIconFontName) Images by providing a URL (iconImageUrl) Info: Waldek Mastykarz wrote a great article about this a while ago.

Read more

SharePoint Framework code coverage reports for unit-tests

A while ago I wrote an article about writing unit tests for your SharePoint Framework components. One of the missing things was a code coverage report to check how well you unit-test your codebase. Read more: Writing unit-tests for your SharePoint Framework components Apparently, with the v1.2.0 of SharePoint Framework they added a tool called Istanbul which can generate such reports.

Read more
Back to top