<?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 Fixing logical error when testing with describe in Jasmine? in ArcGIS JavaScript Maps SDK Questions</title>
    <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/fixing-logical-error-when-testing-with-describe-in/m-p/481833#M44834</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;IMG alt="" class="jive-emoji image-1 jive-image j-img-original" src="https://community.esri.com/legacyfs/online/509155_issue-1.png" /&gt;&lt;/P&gt;&lt;P&gt;I get this error when running tests for an application. Here is the test:&lt;/P&gt;&lt;P&gt;dateUtil.ts&lt;/P&gt;&lt;P&gt;```&lt;/P&gt;&lt;P&gt;export const isDay = (date: Date) =&amp;gt; {&lt;BR /&gt; const currentHour = date.getHours();&lt;BR /&gt; return currentHour &amp;gt; 6 &amp;amp;&amp;amp; currentHour &amp;lt; 18;&lt;BR /&gt;};&lt;/P&gt;&lt;P&gt;```&lt;/P&gt;&lt;P&gt;dateUtil.spec.ts&lt;/P&gt;&lt;P&gt;```&lt;/P&gt;&lt;P&gt;import { isDay } from "./dateUtil";&lt;/P&gt;&lt;P&gt;describe("utils/dateUtil", () =&amp;gt; {&lt;BR /&gt; describe("isDate", () =&amp;gt; {&lt;BR /&gt; it("should determine if time of day is day or night", () =&amp;gt; {&lt;BR /&gt; const day = "Tue Dec 18 2018 12:00:00 GMT-0800 (Pacific Standard Time)";&lt;BR /&gt; const night = "Tue Dec 18 2018 20:00:00 GMT-0800 (Pacific Standard Time)";&lt;/P&gt;&lt;P&gt;expect(isDay(new Date(day))).toBeTruthy();&lt;BR /&gt; expect(isDay(new Date(night))).toBeFalsy();&lt;BR /&gt; });&lt;BR /&gt; });&lt;BR /&gt;});&lt;/P&gt;&lt;P&gt;```&lt;/P&gt;&lt;P&gt;What am I getting wrong?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sun, 04 Oct 2020 09:02:31 GMT</pubDate>
    <dc:creator>EmmanuelAni</dc:creator>
    <dc:date>2020-10-04T09:02:31Z</dc:date>
    <item>
      <title>Fixing logical error when testing with describe in Jasmine?</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/fixing-logical-error-when-testing-with-describe-in/m-p/481833#M44834</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;IMG alt="" class="jive-emoji image-1 jive-image j-img-original" src="https://community.esri.com/legacyfs/online/509155_issue-1.png" /&gt;&lt;/P&gt;&lt;P&gt;I get this error when running tests for an application. Here is the test:&lt;/P&gt;&lt;P&gt;dateUtil.ts&lt;/P&gt;&lt;P&gt;```&lt;/P&gt;&lt;P&gt;export const isDay = (date: Date) =&amp;gt; {&lt;BR /&gt; const currentHour = date.getHours();&lt;BR /&gt; return currentHour &amp;gt; 6 &amp;amp;&amp;amp; currentHour &amp;lt; 18;&lt;BR /&gt;};&lt;/P&gt;&lt;P&gt;```&lt;/P&gt;&lt;P&gt;dateUtil.spec.ts&lt;/P&gt;&lt;P&gt;```&lt;/P&gt;&lt;P&gt;import { isDay } from "./dateUtil";&lt;/P&gt;&lt;P&gt;describe("utils/dateUtil", () =&amp;gt; {&lt;BR /&gt; describe("isDate", () =&amp;gt; {&lt;BR /&gt; it("should determine if time of day is day or night", () =&amp;gt; {&lt;BR /&gt; const day = "Tue Dec 18 2018 12:00:00 GMT-0800 (Pacific Standard Time)";&lt;BR /&gt; const night = "Tue Dec 18 2018 20:00:00 GMT-0800 (Pacific Standard Time)";&lt;/P&gt;&lt;P&gt;expect(isDay(new Date(day))).toBeTruthy();&lt;BR /&gt; expect(isDay(new Date(night))).toBeFalsy();&lt;BR /&gt; });&lt;BR /&gt; });&lt;BR /&gt;});&lt;/P&gt;&lt;P&gt;```&lt;/P&gt;&lt;P&gt;What am I getting wrong?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 04 Oct 2020 09:02:31 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/fixing-logical-error-when-testing-with-describe-in/m-p/481833#M44834</guid>
      <dc:creator>EmmanuelAni</dc:creator>
      <dc:date>2020-10-04T09:02:31Z</dc:date>
    </item>
    <item>
      <title>Re: Fixing logical error when testing with describe in Jasmine?</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/fixing-logical-error-when-testing-with-describe-in/m-p/481834#M44835</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I found out that the date makes a time shift according to your machine's time zone. Change the test date accordingly, e.g. '&lt;SPAN style="color: #222222; background-color: #ffffff;"&gt;Sun Oct 04 2020 10:23:31 GMT+0100 (West Africa Standard Time)'&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 04 Oct 2020 09:33:48 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/fixing-logical-error-when-testing-with-describe-in/m-p/481834#M44835</guid>
      <dc:creator>EmmanuelAni</dc:creator>
      <dc:date>2020-10-04T09:33:48Z</dc:date>
    </item>
  </channel>
</rss>

