<?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 Experience Builder Developer Edition: Tests fail to run in ArcGIS Experience Builder Questions</title>
    <link>https://community.esri.com/t5/arcgis-experience-builder-questions/experience-builder-developer-edition-tests-fail-to/m-p/1079020#M2420</link>
    <description>&lt;P&gt;Hello all,&lt;BR /&gt;&lt;BR /&gt;Not sure if there is a GitHub repo that I can submit an issue to, but I have noticed that in the &lt;STRONG&gt;1.4&lt;/STRONG&gt; release of the &lt;STRONG&gt;ArcGIS Experience Builder Developer Edition&lt;/STRONG&gt; the command &lt;STRONG&gt;npm run test&lt;/STRONG&gt; will fail with the error:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markdown"&gt;my-pc ~/Desktop/ArcGISExperienceBuilder/client
$ npm run test
&amp;gt; exb-client@1.4.0 test C:\Users\user\Desktop\ArcGISExperienceBuilder\client
&amp;gt; jest --runInBand
 FAIL  your-extensions/widgets/simple/tests/simple-widget.test.tsx
  ● Test suite failed to run
    TypeError: global.systemRegister is not a function
      at SystemJS.Object.&amp;lt;anonymous&amp;gt;.System.register (dist/jimu-core/react.js:18:16)
      at Object.&amp;lt;anonymous&amp;gt; (dist/jimu-core/react.js:26:12)
      at Object.&amp;lt;anonymous&amp;gt; (node_modules/@wojtekmaj/enzyme-adapter-react-17/src/ReactSeventeenAdapter.js:2:1)
      at Object.&amp;lt;anonymous&amp;gt; (node_modules/@wojtekmaj/enzyme-adapter-react-17/src/index.js:2:18)
      at Object.&amp;lt;anonymous&amp;gt; (jimu-for-test/setup-jest.js:3:17)
Test Suites: 1 failed, 1 total
Tests:       0 total
Snapshots:   0 total
Time:        11.737 s
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! exb-client@1.4.0 test: `jest --runInBand`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the exb-client@1.4.0 test script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\user\AppData\Roaming\npm-cache\_logs\2021-07-14T23_39_11_102Z-debug.log&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;After looking around the community board it looks like someone noticed this issue a little while ago and mentions the fix&amp;nbsp;&lt;A title="https://community.esri.com/t5/arcgis-experience-builder/how-to-execute-test-for-quot-simple-quot-sample-custom-widget/m-p/1077529#M2377" href="https://community.esri.com/t5/arcgis-experience-builder/how-to-execute-test-for-quot-simple-quot-sample-custom-widget/m-p/1077529#M2377" target="_blank" rel="noopener"&gt;here&lt;/A&gt;&amp;nbsp;.&lt;BR /&gt;&lt;BR /&gt;It seems like the fix for this is to adjust the &lt;STRONG&gt;client/jimu-for-test/setup-jest.js&amp;nbsp;&lt;/STRONG&gt;like the following code:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;// require('jest-fetch-mock').enableMocks()
// const Enzyme = require('enzyme');
// const Adapter = require('@wojtekmaj/enzyme-adapter-react-17')
// const { System } = require('systemjs');
// Enzyme.configure({ adapter: new Adapter() });
// global.systemRegister = System.register;
require('jest-fetch-mock').enableMocks()
const { System } = require('systemjs');
global.systemRegister = System.register;
const Enzyme = require('enzyme');
const Adapter = require('@wojtekmaj/enzyme-adapter-react-17')
Enzyme.configure({ adapter: new Adapter() });&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The commented out code is the code that is originally in the file and the code that is bellow is the adjustment to make tests work.&lt;/P&gt;&lt;P&gt;How has everyone been testing their code?&lt;/P&gt;</description>
    <pubDate>Thu, 15 Jul 2021 01:10:10 GMT</pubDate>
    <dc:creator>RYANCARL</dc:creator>
    <dc:date>2021-07-15T01:10:10Z</dc:date>
    <item>
      <title>Experience Builder Developer Edition: Tests fail to run</title>
      <link>https://community.esri.com/t5/arcgis-experience-builder-questions/experience-builder-developer-edition-tests-fail-to/m-p/1079020#M2420</link>
      <description>&lt;P&gt;Hello all,&lt;BR /&gt;&lt;BR /&gt;Not sure if there is a GitHub repo that I can submit an issue to, but I have noticed that in the &lt;STRONG&gt;1.4&lt;/STRONG&gt; release of the &lt;STRONG&gt;ArcGIS Experience Builder Developer Edition&lt;/STRONG&gt; the command &lt;STRONG&gt;npm run test&lt;/STRONG&gt; will fail with the error:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markdown"&gt;my-pc ~/Desktop/ArcGISExperienceBuilder/client
$ npm run test
&amp;gt; exb-client@1.4.0 test C:\Users\user\Desktop\ArcGISExperienceBuilder\client
&amp;gt; jest --runInBand
 FAIL  your-extensions/widgets/simple/tests/simple-widget.test.tsx
  ● Test suite failed to run
    TypeError: global.systemRegister is not a function
      at SystemJS.Object.&amp;lt;anonymous&amp;gt;.System.register (dist/jimu-core/react.js:18:16)
      at Object.&amp;lt;anonymous&amp;gt; (dist/jimu-core/react.js:26:12)
      at Object.&amp;lt;anonymous&amp;gt; (node_modules/@wojtekmaj/enzyme-adapter-react-17/src/ReactSeventeenAdapter.js:2:1)
      at Object.&amp;lt;anonymous&amp;gt; (node_modules/@wojtekmaj/enzyme-adapter-react-17/src/index.js:2:18)
      at Object.&amp;lt;anonymous&amp;gt; (jimu-for-test/setup-jest.js:3:17)
Test Suites: 1 failed, 1 total
Tests:       0 total
Snapshots:   0 total
Time:        11.737 s
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! exb-client@1.4.0 test: `jest --runInBand`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the exb-client@1.4.0 test script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\user\AppData\Roaming\npm-cache\_logs\2021-07-14T23_39_11_102Z-debug.log&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;After looking around the community board it looks like someone noticed this issue a little while ago and mentions the fix&amp;nbsp;&lt;A title="https://community.esri.com/t5/arcgis-experience-builder/how-to-execute-test-for-quot-simple-quot-sample-custom-widget/m-p/1077529#M2377" href="https://community.esri.com/t5/arcgis-experience-builder/how-to-execute-test-for-quot-simple-quot-sample-custom-widget/m-p/1077529#M2377" target="_blank" rel="noopener"&gt;here&lt;/A&gt;&amp;nbsp;.&lt;BR /&gt;&lt;BR /&gt;It seems like the fix for this is to adjust the &lt;STRONG&gt;client/jimu-for-test/setup-jest.js&amp;nbsp;&lt;/STRONG&gt;like the following code:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;// require('jest-fetch-mock').enableMocks()
// const Enzyme = require('enzyme');
// const Adapter = require('@wojtekmaj/enzyme-adapter-react-17')
// const { System } = require('systemjs');
// Enzyme.configure({ adapter: new Adapter() });
// global.systemRegister = System.register;
require('jest-fetch-mock').enableMocks()
const { System } = require('systemjs');
global.systemRegister = System.register;
const Enzyme = require('enzyme');
const Adapter = require('@wojtekmaj/enzyme-adapter-react-17')
Enzyme.configure({ adapter: new Adapter() });&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The commented out code is the code that is originally in the file and the code that is bellow is the adjustment to make tests work.&lt;/P&gt;&lt;P&gt;How has everyone been testing their code?&lt;/P&gt;</description>
      <pubDate>Thu, 15 Jul 2021 01:10:10 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-experience-builder-questions/experience-builder-developer-edition-tests-fail-to/m-p/1079020#M2420</guid>
      <dc:creator>RYANCARL</dc:creator>
      <dc:date>2021-07-15T01:10:10Z</dc:date>
    </item>
  </channel>
</rss>

