Fail a Node test filter that matches nothing
A focused test command is useful before a small dependency update or a narrow code change. Running one named behavior is faster than running an entire suite, and it gives a reviewer a direct answer about the part of the application that changed. The command is only useful, though, if the name filter actually selects a test.
Node’s built-in test runner accepts --test-name-pattern for that purpose. In a disposable Node 22.23.2 project, a pattern matching one top-level test returned zero. A pattern matching no test names also returned zero. Its TAP output began with 1..0, then reported the test file itself as a successful subtest. A CI job that treats the process exit status as the whole result can therefore accept a focused check that exercised none of the intended assertions.