<p dir="auto">Hi,<br>
I'm currently working on a <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="726757923" data-permission-text="Title is private" data-url="https://github.com/denoland/deno/issues/8063" data-hovercard-type="pull_request" data-hovercard-url="/denoland/deno/pull/8063/hovercard" href="https://github.com/denoland/deno/pull/8063">#8063</a> to make assertions handle <code class="notranslate">symbols</code> correctly, but it seems to reveal a broken test case.</p>
<p dir="auto">The test in question is <a href="https://github.com/denoland/deno/blob/master/cli/tests/unit/response_test.ts#L40-L51"><code class="notranslate">responseFormData</code></a> which is below :</p>
<div class="highlight highlight-source-ts notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="unitTest(async function responseFormData() {
  const input = new FormData();
  input.append(&quot;hello&quot;, &quot;world&quot;);
  const response = new Response(input, {
    headers: { &quot;content-type&quot;: &quot;application/x-www-form-urlencoded&quot; },
  });
  const formDataPromise = response.formData();
  assert(formDataPromise instanceof Promise);
  const formData = await formDataPromise;
  assert(formData instanceof FormData);
  assertEquals(formData, input);
});"><pre class="notranslate"><span class="pl-en">unitTest</span><span class="pl-kos">(</span><span class="pl-k">async</span> <span class="pl-k">function</span> <span class="pl-en">responseFormData</span><span class="pl-kos">(</span><span class="pl-kos">)</span> <span class="pl-kos">{</span>
  <span class="pl-k">const</span> <span class="pl-s1">input</span> <span class="pl-c1">=</span> <span class="pl-k">new</span> <span class="pl-smi">FormData</span><span class="pl-kos">(</span><span class="pl-kos">)</span><span class="pl-kos">;</span>
  <span class="pl-s1">input</span><span class="pl-kos">.</span><span class="pl-en">append</span><span class="pl-kos">(</span><span class="pl-s">"hello"</span><span class="pl-kos">,</span> <span class="pl-s">"world"</span><span class="pl-kos">)</span><span class="pl-kos">;</span>
  <span class="pl-k">const</span> <span class="pl-s1">response</span> <span class="pl-c1">=</span> <span class="pl-k">new</span> <span class="pl-smi">Response</span><span class="pl-kos">(</span><span class="pl-s1">input</span><span class="pl-kos">,</span> <span class="pl-kos">{</span>
    <span class="pl-c1">headers</span>: <span class="pl-kos">{</span> <span class="pl-s">"content-type"</span>: <span class="pl-s">"application/x-www-form-urlencoded"</span> <span class="pl-kos">}</span><span class="pl-kos">,</span>
  <span class="pl-kos">}</span><span class="pl-kos">)</span><span class="pl-kos">;</span>
  <span class="pl-k">const</span> <span class="pl-s1">formDataPromise</span> <span class="pl-c1">=</span> <span class="pl-s1">response</span><span class="pl-kos">.</span><span class="pl-en">formData</span><span class="pl-kos">(</span><span class="pl-kos">)</span><span class="pl-kos">;</span>
  <span class="pl-en">assert</span><span class="pl-kos">(</span><span class="pl-s1">formDataPromise</span> <span class="pl-k">instanceof</span> <span class="pl-smi">Promise</span><span class="pl-kos">)</span><span class="pl-kos">;</span>
  <span class="pl-k">const</span> <span class="pl-s1">formData</span> <span class="pl-c1">=</span> <span class="pl-k">await</span> <span class="pl-s1">formDataPromise</span><span class="pl-kos">;</span>
  <span class="pl-en">assert</span><span class="pl-kos">(</span><span class="pl-s1">formData</span> <span class="pl-k">instanceof</span> <span class="pl-smi">FormData</span><span class="pl-kos">)</span><span class="pl-kos">;</span>
  <span class="pl-en">assertEquals</span><span class="pl-kos">(</span><span class="pl-s1">formData</span><span class="pl-kos">,</span> <span class="pl-s1">input</span><span class="pl-kos">)</span><span class="pl-kos">;</span>
<span class="pl-kos">}</span><span class="pl-kos">)</span><span class="pl-kos">;</span></pre></div>
<p dir="auto">It fails with the following result when using <code class="notranslate">symbol</code> checks :</p>
<div class="highlight highlight-source-diff notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="AssertionError: Values are not equal:
    [Diff] Actual / Expected
    FormData {
      [Symbol(data)]: [
        [
-         &quot;[object FormData]&quot;,
-         &quot;&quot;,
+         &quot;hello&quot;,
+         &quot;world&quot;,
        ],
      ],
    }"><pre class="notranslate">AssertionError: Values are not equal:
    [Diff] Actual / Expected
    FormData {
      [Symbol(data)]: [
        [
<span class="pl-md"><span class="pl-md">-</span>         "[object FormData]",</span>
<span class="pl-md"><span class="pl-md">-</span>         "",</span>
<span class="pl-mi1"><span class="pl-mi1">+</span>         "hello",</span>
<span class="pl-mi1"><span class="pl-mi1">+</span>         "world",</span>
        ],
      ],
    }</pre></div>
<p dir="auto">With <code class="notranslate">Deno.inspect</code> , <code class="notranslate">input</code> returns <code class="notranslate">FormData { [Symbol(data)]: [ [ "hello", "world" ] ] </code> while <code class="notranslate">formData</code> returns <code class="notranslate">FormData { [Symbol(data)]: [ [ "[object FormData]", "" ] ] }</code> (like if the formData was casted to string mistakenly).</p>
<p dir="auto">My guess is that since data are indexed with a <code class="notranslate">symbol</code> instead of a regular key, the <code class="notranslate">assertEquals</code> was actually ignoring it (because it uses <code class="notranslate">for (const key in object)</code> which doesn't include symbols).</p>
<p dir="auto">It could possibly mean that <code class="notranslate">response.formData()</code> or this test case is actually broken.</p>
<p dir="auto"><strong>Is your feature request related to a problem? Please describe.</strong><br>
Not a problem, but support for TypeScript 4.0 would be good in Deno - especially to test forward compatibility for modules written in TS &lt;=3.9 and come up with a release schedule for TypeScript updates in future versions of Deno.</p>
<ul dir="auto">
<li>
<p dir="auto">Typescript 4.0 is available on August 20th, 2020 <a href="https://devblogs.microsoft.com/typescript/announcing-typescript-4-0/" rel="nofollow">https://devblogs.microsoft.com/typescript/announcing-typescript-4-0/</a></p>
</li>
<li>
<p dir="auto">Deno 1.3.0 supports typescript 3.9.7</p>
  <details>
  <summary>Console output</summary>
<div class="highlight highlight-text-shell-session notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content=" $ deno --version
 deno 1.3.0
 v8 8.6.334
 typescript 3.9.7"><pre class="notranslate"><span class="pl-c1"> $ deno --version</span>
<span class="pl-c1"> deno 1.3.0</span>
<span class="pl-c1"> v8 8.6.334</span>
<span class="pl-c1"> typescript 3.9.7</span></pre></div>
  </details>
</li>
</ul>
<p dir="auto"><strong>Describe the solution you'd like</strong><br>
Support TypeScript 4.0 in future minor version of Deno (say 1.4.0?)<br>
A WIP PR was posted on Jun 26 <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="646599207" data-permission-text="Title is private" data-url="https://github.com/denoland/deno/issues/6514" data-hovercard-type="pull_request" data-hovercard-url="/denoland/deno/pull/6514/hovercard" href="https://github.com/denoland/deno/pull/6514">#6514</a>, but deno_typescript was removed on Jul 19 in <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="661054438" data-permission-text="Title is private" data-url="https://github.com/denoland/deno/issues/6813" data-hovercard-type="pull_request" data-hovercard-url="/denoland/deno/pull/6813/hovercard" href="https://github.com/denoland/deno/pull/6813">#6813</a> as a follow-up to porting internal TS code to JS <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="660223828" data-permission-text="Title is private" data-url="https://github.com/denoland/deno/issues/6793" data-hovercard-type="pull_request" data-hovercard-url="/denoland/deno/pull/6793/hovercard" href="https://github.com/denoland/deno/pull/6793">#6793</a></p>
<p dir="auto"><strong>Describe alternatives you've considered</strong><br>
Stick with TypeScript 3.9 in Deno in foreseeable future</p>