Unit test cases for Office js library using Angular13 framework

SK 1 Reputation point
2022-03-28T07:43:16.45+00:00

We are developing outlook add-in using Angular 13 framework and trying to write unit test cases for it.

We have tried and tested the examples which is mentioned in official documentation.

Unable to execute test cases using Jest/Jasmine framework due to the Office JS as we are creating mock data for Office JS library.

Facing issues like:

Error: "The error below may be caused by using the wrong test environment, see https://jestjs.io/docs/configuration#testenvironment-string. Consider using the "jsdom" test environment."

And if we set the test environment to jsdom, we get the error as mentioned below:
Error: "The error below may be caused by using the wrong test environment, see https://jestjs.io/docs/configuration#testenvironment-string. Consider using the "node" test environment." and vice-versa

Is there any solution to resolve this issue?

JavaScript API
JavaScript API
An Office service that supports add-ins to interact with objects in Office client applications.
868 questions
Office Development
Office Development
Office: A suite of Microsoft productivity software that supports common business tasks, including word processing, email, presentations, and data management and analysis.Development: The process of researching, productizing, and refining new or existing technologies.
3,488 questions
Outlook Management
Outlook Management
Outlook: A family of Microsoft email and calendar products.Management: The act or process of organizing, handling, directing or controlling something.
4,886 questions
0 comments No comments
{count} votes