<p dir="auto">Deno lint in 1.4.0 is flagging this piece of code unreachable.</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="    switch (token) {
      case &quot;auto&quot;:
        return i + &quot;width: auto;&quot; + nl;
      case &quot;full&quot;:
        return i + &quot;width: 100%;&quot; + nl;
      case &quot;screen&quot;:
        return i + &quot;width: 100vw;&quot; + nl;
      case &quot;min-content&quot;:
        return i + &quot;width: -webkit-min-content;&quot; + nl +
          i + &quot;width: -moz-min-content;&quot; + nl +
          i + &quot;width: min-content;&quot; + nl;
      case &quot;max-content&quot;:
        return i + &quot;width: -webkit-max-content;&quot; + nl +
          i + &quot;width: -moz-max-content;&quot; + nl +
          i + &quot;width: max-content;&quot; + nl;
    }

    return i + &quot;width: &quot; + calcUnit(token) + &quot;;&quot; + nl;"><pre class="notranslate"><code class="notranslate">    switch (token) {
      case "auto":
        return i + "width: auto;" + nl;
      case "full":
        return i + "width: 100%;" + nl;
      case "screen":
        return i + "width: 100vw;" + nl;
      case "min-content":
        return i + "width: -webkit-min-content;" + nl +
          i + "width: -moz-min-content;" + nl +
          i + "width: min-content;" + nl;
      case "max-content":
        return i + "width: -webkit-max-content;" + nl +
          i + "width: -moz-max-content;" + nl +
          i + "width: max-content;" + nl;
    }

    return i + "width: " + calcUnit(token) + ";" + nl;
</code></pre></div>
<p dir="auto">Specifically the last line. As a switch without a default, it would fall through the switch to the bottom return statement.</p>
<p dir="auto">This get's flagged as part of <code class="notranslate">no-unreachable</code> rule.</p>
<p dir="auto">Previous related issues:</p>
<ul dir="auto">
<li><a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="647534313" data-permission-text="Title is private" data-url="https://github.com/denoland/deno/issues/6559" data-hovercard-type="issue" data-hovercard-url="/denoland/deno/issues/6559/hovercard" href="https://github.com/denoland/deno/issues/6559">#6559</a></li>
<li><a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="705744529" data-permission-text="Title is private" data-url="https://github.com/denoland/deno/issues/7615" data-hovercard-type="issue" data-hovercard-url="/denoland/deno/issues/7615/hovercard" href="https://github.com/denoland/deno/issues/7615">#7615</a> (marked as duplicate of 6559)</li>
</ul>
<p dir="auto">These seem to be considered resolved via the <code class="notranslate">-j</code> flag implemented by <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="833904902" data-permission-text="Title is private" data-url="https://github.com/denoland/deno/issues/9815" data-hovercard-type="pull_request" data-hovercard-url="/denoland/deno/pull/9815/hovercard" href="https://github.com/denoland/deno/pull/9815">#9815</a>.</p>
<p dir="auto"><code class="notranslate">-j</code> is definitely a welcome improvement. However, it's only enabling separate test files to run parallel. I believe instead the expectation is that parallelism be supported <em>within the same file</em>. In any case, I would like to request this feature.</p>
<p dir="auto">For example:</p>
<div class="highlight highlight-source-ts notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="// test/blah.ts

Deno.test(&quot;foo&quot;, async () =&gt; {
  console.log(&quot;start foo&quot;);
  await new Promise((resolve) =&gt; setTimeout(resolve, 1000));
  console.log(&quot;end foo&quot;);
});

Deno.test(&quot;bar&quot;, async () =&gt; {
  console.log(&quot;start bar&quot;);
  await new Promise((resolve) =&gt; setTimeout(resolve, 1000));
  console.log(&quot;end bar&quot;);
});"><pre class="notranslate"><span class="pl-c">// test/blah.ts</span>

<span class="pl-smi">Deno</span><span class="pl-kos">.</span><span class="pl-en">test</span><span class="pl-kos">(</span><span class="pl-s">"foo"</span><span class="pl-kos">,</span> <span class="pl-k">async</span> <span class="pl-kos">(</span><span class="pl-kos">)</span> <span class="pl-c1">=&gt;</span> <span class="pl-kos">{</span>
  <span class="pl-smi">console</span><span class="pl-kos">.</span><span class="pl-en">log</span><span class="pl-kos">(</span><span class="pl-s">"start foo"</span><span class="pl-kos">)</span><span class="pl-kos">;</span>
  <span class="pl-k">await</span> <span class="pl-k">new</span> <span class="pl-smi">Promise</span><span class="pl-kos">(</span><span class="pl-kos">(</span><span class="pl-s1">resolve</span><span class="pl-kos">)</span> <span class="pl-c1">=&gt;</span> <span class="pl-en">setTimeout</span><span class="pl-kos">(</span><span class="pl-s1">resolve</span><span class="pl-kos">,</span> <span class="pl-c1">1000</span><span class="pl-kos">)</span><span class="pl-kos">)</span><span class="pl-kos">;</span>
  <span class="pl-smi">console</span><span class="pl-kos">.</span><span class="pl-en">log</span><span class="pl-kos">(</span><span class="pl-s">"end foo"</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-smi">Deno</span><span class="pl-kos">.</span><span class="pl-en">test</span><span class="pl-kos">(</span><span class="pl-s">"bar"</span><span class="pl-kos">,</span> <span class="pl-k">async</span> <span class="pl-kos">(</span><span class="pl-kos">)</span> <span class="pl-c1">=&gt;</span> <span class="pl-kos">{</span>
  <span class="pl-smi">console</span><span class="pl-kos">.</span><span class="pl-en">log</span><span class="pl-kos">(</span><span class="pl-s">"start bar"</span><span class="pl-kos">)</span><span class="pl-kos">;</span>
  <span class="pl-k">await</span> <span class="pl-k">new</span> <span class="pl-smi">Promise</span><span class="pl-kos">(</span><span class="pl-kos">(</span><span class="pl-s1">resolve</span><span class="pl-kos">)</span> <span class="pl-c1">=&gt;</span> <span class="pl-en">setTimeout</span><span class="pl-kos">(</span><span class="pl-s1">resolve</span><span class="pl-kos">,</span> <span class="pl-c1">1000</span><span class="pl-kos">)</span><span class="pl-kos">)</span><span class="pl-kos">;</span>
  <span class="pl-smi">console</span><span class="pl-kos">.</span><span class="pl-en">log</span><span class="pl-kos">(</span><span class="pl-s">"end bar"</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">Running with <code class="notranslate">-j4</code>:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="$ deno test -j4 test/blah.test.ts
running 2 tests from file:///home/voltrevo/workspaces/ethf/aggregator/test/blah.test.ts
start foo
end foo
test foo ... ok (1008ms)
start bar
end bar
test bar ... ok (1006ms)

test result: ok. 2 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out (2031ms)"><pre class="notranslate"><code class="notranslate">$ deno test -j4 test/blah.test.ts
running 2 tests from file:///home/voltrevo/workspaces/ethf/aggregator/test/blah.test.ts
start foo
end foo
test foo ... ok (1008ms)
start bar
end bar
test bar ... ok (1006ms)

test result: ok. 2 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out (2031ms)
</code></pre></div>
<p dir="auto">If parallelism was enabled between these tests, we should expect output more like this:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="running 2 tests from file:///home/voltrevo/workspaces/ethf/aggregator/test/blah.test.ts
start foo
start bar
end foo
test foo ... ok (1008ms)
end bar
test bar ... ok (1006ms)

test result: ok. 2 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out (1031ms)"><pre class="notranslate"><code class="notranslate">running 2 tests from file:///home/voltrevo/workspaces/ethf/aggregator/test/blah.test.ts
start foo
start bar
end foo
test foo ... ok (1008ms)
end bar
test bar ... ok (1006ms)

test result: ok. 2 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out (1031ms)
</code></pre></div>
<p dir="auto">(Implementing this might be considered a breaking change, requiring a new flag, perhaps <code class="notranslate">-jj</code>.)</p>
<p dir="auto">Can you confirm that this kind of parallelism is not yet supported or advise how to enable it?</p>
<p dir="auto">If it's not supported, are there any intentions to implement this?</p>
<p dir="auto">(It's also possible to enable this kind of concurrency for synchronous tests, by running a first pass to identify test names and then running separate processes with different filters. Can this also be considered?)</p>