<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Help with writing unit tests - asMutable() is not a function in ArcGIS JavaScript Maps SDK Questions</title>
    <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/help-with-writing-unit-tests-asmutable-is-not-a/m-p/1332963#M82335</link>
    <description>&lt;P&gt;Hi&lt;/P&gt;&lt;P&gt;Im trying to get my head around writing unit tests for me Experience Builder widgets using Jest.&lt;/P&gt;&lt;P&gt;Im finding the Ersi docs/example quite limited, there are only 2 widgets in the samples folder with tests!&lt;/P&gt;&lt;P&gt;Anyway, My first hickup is, in my widget code, the config is an immutable object, and it gets copied using config.asMutable() ... jest complains that asMutable() is not a function.&amp;nbsp; How should I work around this?&lt;/P&gt;&lt;P&gt;I have other cases such as using the SessionManager, do I need to mock these?&lt;/P&gt;&lt;P&gt;Thanks for any tips&lt;/P&gt;&lt;P&gt;Adam&lt;/P&gt;</description>
    <pubDate>Wed, 27 Sep 2023 15:30:54 GMT</pubDate>
    <dc:creator>AdamPigg</dc:creator>
    <dc:date>2023-09-27T15:30:54Z</dc:date>
    <item>
      <title>Help with writing unit tests - asMutable() is not a function</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/help-with-writing-unit-tests-asmutable-is-not-a/m-p/1332963#M82335</link>
      <description>&lt;P&gt;Hi&lt;/P&gt;&lt;P&gt;Im trying to get my head around writing unit tests for me Experience Builder widgets using Jest.&lt;/P&gt;&lt;P&gt;Im finding the Ersi docs/example quite limited, there are only 2 widgets in the samples folder with tests!&lt;/P&gt;&lt;P&gt;Anyway, My first hickup is, in my widget code, the config is an immutable object, and it gets copied using config.asMutable() ... jest complains that asMutable() is not a function.&amp;nbsp; How should I work around this?&lt;/P&gt;&lt;P&gt;I have other cases such as using the SessionManager, do I need to mock these?&lt;/P&gt;&lt;P&gt;Thanks for any tips&lt;/P&gt;&lt;P&gt;Adam&lt;/P&gt;</description>
      <pubDate>Wed, 27 Sep 2023 15:30:54 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/help-with-writing-unit-tests-asmutable-is-not-a/m-p/1332963#M82335</guid>
      <dc:creator>AdamPigg</dc:creator>
      <dc:date>2023-09-27T15:30:54Z</dc:date>
    </item>
  </channel>
</rss>

