diff --git a/.configs/vitest.config.mjs b/.configs/vitest.config.mjs index b485fa3..483c5d7 100644 --- a/.configs/vitest.config.mjs +++ b/.configs/vitest.config.mjs @@ -7,7 +7,7 @@ const root = path.resolve(path.dirname(fileURLToPath(import.meta.url)), ".."); export default defineConfig({ root, test: { - include: ["tests/**/*.test.mjs"], + include: ["tests/**/*.test.vitest.mjs"], exclude: ["node_modules"], environment: "node", testTimeout: 30000, diff --git a/tests/gitmulti.cli.test.mjs b/tests/gitmulti.cli.test.vitest.mjs similarity index 92% rename from tests/gitmulti.cli.test.mjs rename to tests/gitmulti.cli.test.vitest.mjs index 001c0d0..61e65b4 100644 --- a/tests/gitmulti.cli.test.mjs +++ b/tests/gitmulti.cli.test.vitest.mjs @@ -2,11 +2,11 @@ * End-to-end characterization of the gitmulti CLI entry point via a real, * fully isolated subprocess (spawnSync of `node gitmulti.js `). * - * This complements gitmulti.test.mjs, which drives gitmulti.js in-process for + * This complements gitmulti.test.vitest.mjs, which drives gitmulti.js in-process for * statement/branch coverage. Two scenarios cannot be driven that way without * either mocking `child_process` (which does not work here — commander's * internal `require("child_process")` is not reachable by `vi.mock`, see the - * comment at the top of gitmulti.test.mjs) or letting a real spawn attempt + * comment at the top of gitmulti.test.vitest.mjs) or letting a real spawn attempt * happen inside the test worker process (which leaks an async `process.exit` * call that fires after the test body returns and trips Vitest's * unexpected-exit detector). Running the real CLI as a genuine child process @@ -15,7 +15,7 @@ * * This does not shell out to `git` and never touches a real repository or * the filesystem beyond the ENOENT spawn attempt below — gitmulti.js has no - * git/`.gitmulti` handling of its own yet (see gitmulti.test.mjs's file + * git/`.gitmulti` handling of its own yet (see gitmulti.test.vitest.mjs's file * banner); the "list" subcommand it declares as its default is meant to be * an executable sibling file (`gitmulti-list`) that does not exist in this * package, so invoking it is expected, currently, to fail. diff --git a/tests/gitmulti.test.mjs b/tests/gitmulti.test.vitest.mjs similarity index 99% rename from tests/gitmulti.test.mjs rename to tests/gitmulti.test.vitest.mjs index 41400b3..ca09a8d 100644 --- a/tests/gitmulti.test.mjs +++ b/tests/gitmulti.test.vitest.mjs @@ -35,7 +35,7 @@ * in-process — no matching flag/command, which falls through to commander's * `defaultExecutable` ("list") and really attempts to spawn a `gitmulti-list` * executable that does not exist in this package — is characterized instead - * via a real, fully isolated subprocess in gitmulti.cli.test.mjs, so a failed + * via a real, fully isolated subprocess in gitmulti.cli.test.vitest.mjs, so a failed * spawn attempt never touches this test's own process. */ import { describe, it, expect, vi, beforeEach, afterEach } from "vitest"; diff --git a/tests/run-vitest.mjs b/tests/run-vitest.mjs index d6c32ba..8dbdb5e 100644 --- a/tests/run-vitest.mjs +++ b/tests/run-vitest.mjs @@ -26,7 +26,7 @@ const code = await run({ cwd: root, testDir: "tests", vitestConfig: ".configs/vitest.config.mjs", - testFilePattern: /\.test\.mjs$/, + testFilePattern: /\.test\.vitest\.mjs$/, testPatterns, workers, coverageQuiet,