Tag: Unit tests

SharePoint Framework unit-tests with Jest

Back in April 2017, I wrote about how you could write unit tests for SharePoint Framework components. This was created by a combination of the dependencies provides by SharePoint Framework itself and enzyme (JavaScript Testing utilities for React). Info: you can read more about writing unit tests for SharePoint Framework components here: Writing unit tests for your SharePoint Framework components.

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

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

Writing unit tests for your SharePoint Framework components

Last week I published a sample project on GitHub which shows how you can test your SharePoint Framework components with some predefined unit tests. Info: here is a link to the repo - https://github.com/estruyf/spfx-testing-wp The current sample is created with React. The unit tests are created only to test the actual component instead of the main web part.

Read more
Back to top