# Add isolatedModules

**URL:** <https://community.dynatrace.com/t/add-isolatedmodules/42295>\
**Category:** Developer Q&A Forum\
**Tags:** custom-app, coding-assistance\
**Created:** [October 26, 2023, 9:14am UTC](https://community.dynatrace.com/t/add-isolatedmodules/42295 "2023-10-26T09:14:33Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![beigert](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/beigert/32/7422_2.png) [@beigert](https://community.dynatrace.com/u/beigert)\
**Post date:** [October 26, 2023, 9:14am UTC](https://community.dynatrace.com/t/add-isolatedmodules/42295/1 "2023-10-26T09:14:33Z")

</div>

Right now documentation suggest fields like this in the jest.config:&nbsp;[link](https://developer.dynatrace.com/develop/testing/unit-tests/#handling-style-imports)

```auto
transform<span>: </span><span>{<br></span> <span>".(css|scss|sass|less)$"</span><span>: </span><span>"<rootDir>/style-mock.ts"</span><span>,</span><span><br></span><span>},</span>

```

I suggest to add another transform:

```auto
<span>"^.+</span><span>\\</span><span>.(t|j)sx?$"</span><span>: </span><span>[</span><span>"ts-jest"</span><span>, { </span>isolatedModules<span>: true </span><span>}],</span>

```

It might sharply decrease the execution time of jest tests.

In our case, this change reduces execution time from 20-40s\* to 10s (34 test suites, 140 tests on Apple m1 chip)

\* 40s only in case when jest runs tests without starting from the slowest one. Usually it takes 20-25s

---

<div class="post-metadata">

**Author:** ![imsingh](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/imsingh/32/7858_2.png) [@imsingh](https://community.dynatrace.com/u/imsingh)\
**Post date:** [October 27, 2023, 1:59pm UTC](https://community.dynatrace.com/t/add-isolatedmodules/42295/2 "2023-10-27T13:59:37Z")

</div>

I’ll let the team know about this and then we’ll update the docs if necessary.
