<p dir="auto">Specifying a file isn't required to run deno test.  It will run all the tests in the directory I'm running the command in.</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="$ deno test -A
Check file:///home/kyle/Projects/deno/react_app/env_test.ts
running 10 tests from ./env_test.ts
..."><pre class="notranslate"><code class="notranslate">$ deno test -A
Check file:///home/kyle/Projects/deno/react_app/env_test.ts
running 10 tests from ./env_test.ts
...
</code></pre></div>
<p dir="auto">I found that if I add the <code class="notranslate">--watch</code> flag, it wasn't finding any of the files.</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="$ deno test --watch -A
Watcher Test started.

ok | 0 passed | 0 failed (0ms)

Watcher Test finished. Restarting on file change..."><pre class="notranslate"><code class="notranslate">$ deno test --watch -A
Watcher Test started.

ok | 0 passed | 0 failed (0ms)

Watcher Test finished. Restarting on file change...
</code></pre></div>
<p dir="auto">I found that if I add a path like <code class="notranslate">.</code>, it is able to find the test files like it can without the <code class="notranslate">--watch</code> flag.</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="$ deno test --watch -A .
Watcher Test started.
running 10 tests from ./env_test.ts
..."><pre class="notranslate"><code class="notranslate">$ deno test --watch -A .
Watcher Test started.
running 10 tests from ./env_test.ts
...
</code></pre></div>
<p dir="auto">I believe that the test command should be able to find the test files without a path when using the <code class="notranslate">--watch</code> flag, like it can without the <code class="notranslate">--watch</code> flag.</p>
<p dir="auto">Other commands like <code class="notranslate">deno fmt/lint --watch</code>, will watch and fmt/lint all the files in the project if no files are passed on the command line, but this does not seem to work for <code class="notranslate">deno test --watch</code>.</p>
<div class="highlight highlight-source-ts notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="// test.ts
import { assertEquals } from &quot;https://deno.land/std@0.163.0/testing/asserts.ts&quot;;

Deno.test({
  name: &quot;myTest&quot;,
  fn: () =&gt; {
    assertEquals(1+1, 2);
  },
});"><pre class="notranslate"><span class="pl-c">// test.ts</span>
<span class="pl-k">import</span> <span class="pl-kos">{</span> <span class="pl-s1">assertEquals</span> <span class="pl-kos">}</span> <span class="pl-k">from</span> <span class="pl-s">"https://deno.land/std@0.163.0/testing/asserts.ts"</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-kos">{</span>
  <span class="pl-c1">name</span>: <span class="pl-s">"myTest"</span><span class="pl-kos">,</span>
  <span class="pl-en">fn</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-en">assertEquals</span><span class="pl-kos">(</span><span class="pl-c1">1</span><span class="pl-c1">+</span><span class="pl-c1">1</span><span class="pl-kos">,</span> <span class="pl-c1">2</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-kos">)</span><span class="pl-kos">;</span></pre></div>
<p dir="auto">With <code class="notranslate">deno test --watch</code>:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="Watcher Test started.

ok | 0 passed | 0 failed (0ms)

Watcher Test finished. Restarting on file change..."><pre class="notranslate"><code class="notranslate">Watcher Test started.

ok | 0 passed | 0 failed (0ms)

Watcher Test finished. Restarting on file change...
</code></pre></div>
<p dir="auto">Making changes to the test file will not trigger the file watcher.</p>
<p dir="auto">With <code class="notranslate">deno test --watch test.ts</code>:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="Watcher Test started.
running 1 test from ./test.ts
myTest ... ok (24ms)

ok | 1 passed | 0 failed (47ms)

Watcher Test finished. Restarting on file change..."><pre class="notranslate"><code class="notranslate">Watcher Test started.
running 1 test from ./test.ts
myTest ... ok (24ms)

ok | 1 passed | 0 failed (47ms)

Watcher Test finished. Restarting on file change...
</code></pre></div>
<p dir="auto">With <code class="notranslate">deno test</code>:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="Check file:///C:/Users/GJZwiers/repos/test_deno_test/test.ts
running 1 test from ./test.ts
myTest ... ok (8ms)

ok | 1 passed | 0 failed (33ms)"><pre class="notranslate"><code class="notranslate">Check file:///C:/Users/GJZwiers/repos/test_deno_test/test.ts
running 1 test from ./test.ts
myTest ... ok (8ms)

ok | 1 passed | 0 failed (33ms)
</code></pre></div>