From 46760bbe0595aa2f61ba2668f11899baafe8b605 Mon Sep 17 00:00:00 2001 From: Shinrai Date: Sun, 2 Aug 2026 23:20:57 -0700 Subject: [PATCH 1/2] chore(tests): rename test files to *.test.vitest.mjs convention MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Aligns git-embedded — the golden-reference consumer that other CLDMV repos copy their vitest wiring from — with the fleet-wide convention that vitest test files are always named *.test.vitest.mjs. Renames all 17 test files, updates the include/files globs in .configs/vitest.config.mjs and .configs/eslint.config.mjs, and fixes tests/run-vitest.mjs's testFilePattern and its now-stale comment claiming this repo deliberately used the plain *.test.mjs convention. --- .configs/eslint.config.mjs | 2 +- .configs/vitest.config.mjs | 2 +- .../{cli-coverage.test.mjs => cli-coverage.test.vitest.mjs} | 6 +++--- tests/{cli-hooks.test.mjs => cli-hooks.test.vitest.mjs} | 2 +- ...ovisioning.test.mjs => cli-provisioning.test.vitest.mjs} | 2 +- ...mmander-help.test.mjs => commander-help.test.vitest.mjs} | 0 ...ct-coverage.test.mjs => detect-coverage.test.vitest.mjs} | 6 +++--- ...tect-foreign.test.mjs => detect-foreign.test.vitest.mjs} | 0 .../{detect-hooks.test.mjs => detect-hooks.test.vitest.mjs} | 6 +++--- ...lassify.test.mjs => dispatcher-classify.test.vitest.mjs} | 0 ...-coverage.test.mjs => embedded-coverage.test.vitest.mjs} | 2 +- ...oning.test.mjs => embedded-provisioning.test.vitest.mjs} | 0 ...bedded-topup.test.mjs => embedded-topup.test.vitest.mjs} | 2 +- tests/{helpers.test.mjs => helpers.test.vitest.mjs} | 0 tests/{hook-guards.test.mjs => hook-guards.test.vitest.mjs} | 2 +- ...install-hooks.test.mjs => install-hooks.test.vitest.mjs} | 0 .../{install-link.test.mjs => install-link.test.vitest.mjs} | 2 +- ...link-coverage.test.mjs => link-coverage.test.vitest.mjs} | 4 ++-- ...root-coverage.test.mjs => root-coverage.test.vitest.mjs} | 6 +++--- tests/run-vitest.mjs | 4 ++-- 20 files changed, 24 insertions(+), 24 deletions(-) rename tests/{cli-coverage.test.mjs => cli-coverage.test.vitest.mjs} (99%) rename tests/{cli-hooks.test.mjs => cli-hooks.test.vitest.mjs} (99%) rename tests/{cli-provisioning.test.mjs => cli-provisioning.test.vitest.mjs} (99%) rename tests/{commander-help.test.mjs => commander-help.test.vitest.mjs} (100%) rename tests/{detect-coverage.test.mjs => detect-coverage.test.vitest.mjs} (98%) rename tests/{detect-foreign.test.mjs => detect-foreign.test.vitest.mjs} (100%) rename tests/{detect-hooks.test.mjs => detect-hooks.test.vitest.mjs} (98%) rename tests/{dispatcher-classify.test.mjs => dispatcher-classify.test.vitest.mjs} (100%) rename tests/{embedded-coverage.test.mjs => embedded-coverage.test.vitest.mjs} (99%) rename tests/{embedded-provisioning.test.mjs => embedded-provisioning.test.vitest.mjs} (100%) rename tests/{embedded-topup.test.mjs => embedded-topup.test.vitest.mjs} (99%) rename tests/{helpers.test.mjs => helpers.test.vitest.mjs} (100%) rename tests/{hook-guards.test.mjs => hook-guards.test.vitest.mjs} (99%) rename tests/{install-hooks.test.mjs => install-hooks.test.vitest.mjs} (100%) rename tests/{install-link.test.mjs => install-link.test.vitest.mjs} (99%) rename tests/{link-coverage.test.mjs => link-coverage.test.vitest.mjs} (99%) rename tests/{root-coverage.test.mjs => root-coverage.test.vitest.mjs} (98%) diff --git a/.configs/eslint.config.mjs b/.configs/eslint.config.mjs index 2e73ef5..cebb305 100644 --- a/.configs/eslint.config.mjs +++ b/.configs/eslint.config.mjs @@ -37,7 +37,7 @@ export default defineConfig([ { files: ["**/*.js"], languageOptions: { sourceType: "commonjs" } }, { files: ["**/*.{js,mjs,cjs}"], languageOptions: { globals: { ...globals.node } } }, { - files: ["tests/**/*.test.mjs"], + files: ["tests/**/*.test.vitest.mjs"], languageOptions: { globals: { beforeAll: true, diff --git a/.configs/vitest.config.mjs b/.configs/vitest.config.mjs index 86f6afe..649a048 100644 --- a/.configs/vitest.config.mjs +++ b/.configs/vitest.config.mjs @@ -9,7 +9,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", "reference/**"], environment: "node", testTimeout: 30000, diff --git a/tests/cli-coverage.test.mjs b/tests/cli-coverage.test.vitest.mjs similarity index 99% rename from tests/cli-coverage.test.mjs rename to tests/cli-coverage.test.vitest.mjs index 1584c63..e2a4d3f 100644 --- a/tests/cli-coverage.test.mjs +++ b/tests/cli-coverage.test.vitest.mjs @@ -1,11 +1,11 @@ /** * @Project: @cldmv/git-embedded - * @Filename: /tests/cli-coverage.test.mjs + * @Filename: /tests/cli-coverage.test.vitest.mjs * @Copyright: Copyright (c) 2013-2026 Catalyzed Motivation Inc. All rights reserved. * * Gap-closing behavior tests for the CLI wrapper commands (src/api/cli/*.mjs), * driven through the composed slothlet api against REAL temp git repos in the - * same house style as cli-hooks.test.mjs / cli-provisioning.test.mjs. Each test + * same house style as cli-hooks.test.vitest.mjs / cli-provisioning.test.vitest.mjs. Each test * targets an uncovered path the existing suites do not exercise: * * - link: full command coverage (blocksClone refusals, clone/add @@ -119,7 +119,7 @@ function makeDispatcherDir(linked) { return { dir, dispatch }; } -// ---- child-in-parent fixtures (mirrors cli-provisioning.test.mjs) -------- +// ---- child-in-parent fixtures (mirrors cli-provisioning.test.vitest.mjs) -------- function makeChildBare(work, remotes, bareName, marker) { const bare = path.join(remotes, `${bareName}.git`); diff --git a/tests/cli-hooks.test.mjs b/tests/cli-hooks.test.vitest.mjs similarity index 99% rename from tests/cli-hooks.test.mjs rename to tests/cli-hooks.test.vitest.mjs index ecaa956..5583c59 100644 --- a/tests/cli-hooks.test.mjs +++ b/tests/cli-hooks.test.vitest.mjs @@ -1,6 +1,6 @@ /** * @Project: @cldmv/git-embedded - * @Filename: /tests/cli-hooks.test.mjs + * @Filename: /tests/cli-hooks.test.vitest.mjs * @Copyright: Copyright (c) 2013-2026 Catalyzed Motivation Inc. All rights reserved. * * Behavior tests for the CLI wrapper commands that manage git hooks and print diff --git a/tests/cli-provisioning.test.mjs b/tests/cli-provisioning.test.vitest.mjs similarity index 99% rename from tests/cli-provisioning.test.mjs rename to tests/cli-provisioning.test.vitest.mjs index af728ba..3da2161 100644 --- a/tests/cli-provisioning.test.mjs +++ b/tests/cli-provisioning.test.vitest.mjs @@ -6,7 +6,7 @@ import { spawnSync } from "node:child_process"; import { getApi } from "./_setup.mjs"; // These exercise the CLI command wrappers (src/api/cli/{restore,record,export,sync}.mjs) -// against REAL temp git repos — the same fixture style as embedded-provisioning.test.mjs. +// against REAL temp git repos — the same fixture style as embedded-provisioning.test.vitest.mjs. // Each wrapper reads process.cwd(), prints through self.report.* (console.log/error), and // restore/sync end with process.exit(code); we chdir into the fixture, capture the output, // and translate the process.exit into a return code. diff --git a/tests/commander-help.test.mjs b/tests/commander-help.test.vitest.mjs similarity index 100% rename from tests/commander-help.test.mjs rename to tests/commander-help.test.vitest.mjs diff --git a/tests/detect-coverage.test.mjs b/tests/detect-coverage.test.vitest.mjs similarity index 98% rename from tests/detect-coverage.test.mjs rename to tests/detect-coverage.test.vitest.mjs index dfcf37c..c600d54 100644 --- a/tests/detect-coverage.test.mjs +++ b/tests/detect-coverage.test.vitest.mjs @@ -1,10 +1,10 @@ /** * @Project: @cldmv/git-embedded - * @Filename: /tests/detect-coverage.test.mjs + * @Filename: /tests/detect-coverage.test.vitest.mjs * @Copyright: Copyright (c) 2013-2026 Catalyzed Motivation Inc. All rights reserved. * - * Targeted coverage-closing tests for src/api/detect/*. tests/detect-hooks.test.mjs, - * tests/detect-foreign.test.mjs, and tests/dispatcher-classify.test.mjs cover the + * Targeted coverage-closing tests for src/api/detect/*. tests/detect-hooks.test.vitest.mjs, + * tests/detect-foreign.test.vitest.mjs, and tests/dispatcher-classify.test.vitest.mjs cover the * baseline detection patterns; this file adds only the edge cases those don't * reach, closing dispatcher.mjs, husky.mjs, pre-commit.mjs, lefthook.mjs, and * run.mjs to 100% lines/statements/functions/branches: diff --git a/tests/detect-foreign.test.mjs b/tests/detect-foreign.test.vitest.mjs similarity index 100% rename from tests/detect-foreign.test.mjs rename to tests/detect-foreign.test.vitest.mjs diff --git a/tests/detect-hooks.test.mjs b/tests/detect-hooks.test.vitest.mjs similarity index 98% rename from tests/detect-hooks.test.mjs rename to tests/detect-hooks.test.vitest.mjs index 93d8949..cd8768c 100644 --- a/tests/detect-hooks.test.mjs +++ b/tests/detect-hooks.test.vitest.mjs @@ -1,6 +1,6 @@ /** * @Project: @cldmv/git-embedded - * @Filename: /tests/detect-hooks.test.mjs + * @Filename: /tests/detect-hooks.test.vitest.mjs * @Copyright: Copyright (c) 2013-2026 Catalyzed Motivation Inc. All rights reserved. * * Coverage tests for the hook-manager detectors and the detect orchestrator: @@ -18,9 +18,9 @@ * bare / empty), system-scope hooksPath, init.templateDir fallback, and none. * * The detectors are pure-fs and are driven directly with fabricated - * repoRoot/gitDir args (matching tests/detect-foreign.test.mjs). run() shells + * repoRoot/gitDir args (matching tests/detect-foreign.test.vitest.mjs). run() shells * out to real git, so it is driven against real temp repos with a hermetic git - * environment (matching tests/embedded-provisioning.test.mjs). + * environment (matching tests/embedded-provisioning.test.vitest.mjs). */ import { afterEach, beforeAll, beforeEach, describe, expect, it } from "vitest"; diff --git a/tests/dispatcher-classify.test.mjs b/tests/dispatcher-classify.test.vitest.mjs similarity index 100% rename from tests/dispatcher-classify.test.mjs rename to tests/dispatcher-classify.test.vitest.mjs diff --git a/tests/embedded-coverage.test.mjs b/tests/embedded-coverage.test.vitest.mjs similarity index 99% rename from tests/embedded-coverage.test.mjs rename to tests/embedded-coverage.test.vitest.mjs index 82c04c6..8d65b85 100644 --- a/tests/embedded-coverage.test.mjs +++ b/tests/embedded-coverage.test.vitest.mjs @@ -1,6 +1,6 @@ /** * Coverage closure for the embedded engine. These target the error/edge/defensive - * branches that embedded-provisioning.test.mjs and embedded-topup.test.mjs leave + * branches that embedded-provisioning.test.vitest.mjs and embedded-topup.test.vitest.mjs leave * uncovered, against REAL temp git fixtures (house style — no over-mocking): * * - branch.mjs / gitlinks.mjs / registry.mjs — the `res.status ?? 1` spawn-failure diff --git a/tests/embedded-provisioning.test.mjs b/tests/embedded-provisioning.test.vitest.mjs similarity index 100% rename from tests/embedded-provisioning.test.mjs rename to tests/embedded-provisioning.test.vitest.mjs diff --git a/tests/embedded-topup.test.mjs b/tests/embedded-topup.test.vitest.mjs similarity index 99% rename from tests/embedded-topup.test.mjs rename to tests/embedded-topup.test.vitest.mjs index 62380c7..f333f7f 100644 --- a/tests/embedded-topup.test.mjs +++ b/tests/embedded-topup.test.vitest.mjs @@ -1,7 +1,7 @@ /** * Branch top-up coverage for the embedded engine's smaller modules. These * exercise the error paths, ambiguous/edge inputs, and layer-precedence - * branches that embedded-provisioning.test.mjs leaves uncovered: + * branches that embedded-provisioning.test.vitest.mjs leaves uncovered: * * - branch.mjs infer's "on no remote branch" (size 0) and git-error paths, * and attach's checkout-failure + best-effort-upstream branches. diff --git a/tests/helpers.test.mjs b/tests/helpers.test.vitest.mjs similarity index 100% rename from tests/helpers.test.mjs rename to tests/helpers.test.vitest.mjs diff --git a/tests/hook-guards.test.mjs b/tests/hook-guards.test.vitest.mjs similarity index 99% rename from tests/hook-guards.test.mjs rename to tests/hook-guards.test.vitest.mjs index be3fd9d..c4bdaaa 100644 --- a/tests/hook-guards.test.mjs +++ b/tests/hook-guards.test.vitest.mjs @@ -1,6 +1,6 @@ /** * @Project: @cldmv/git-embedded - * @Filename: /tests/hook-guards.test.mjs + * @Filename: /tests/hook-guards.test.vitest.mjs * @Copyright: Copyright (c) 2013-2026 Catalyzed Motivation Inc. All rights reserved. * * Behavior tests for the two guard hooks, driven through REAL git operations diff --git a/tests/install-hooks.test.mjs b/tests/install-hooks.test.vitest.mjs similarity index 100% rename from tests/install-hooks.test.mjs rename to tests/install-hooks.test.vitest.mjs diff --git a/tests/install-link.test.mjs b/tests/install-link.test.vitest.mjs similarity index 99% rename from tests/install-link.test.mjs rename to tests/install-link.test.vitest.mjs index 9540b8c..aba9be3 100644 --- a/tests/install-link.test.mjs +++ b/tests/install-link.test.vitest.mjs @@ -1,6 +1,6 @@ /** * @Project: @cldmv/git-embedded - * @Filename: /tests/install-link.test.mjs + * @Filename: /tests/install-link.test.vitest.mjs * @Copyright: Copyright (c) 2013-2026 Catalyzed Motivation Inc. All rights reserved. * * Behavior tests for the install-dispatch + link-batch layer, driven through diff --git a/tests/link-coverage.test.mjs b/tests/link-coverage.test.vitest.mjs similarity index 99% rename from tests/link-coverage.test.mjs rename to tests/link-coverage.test.vitest.mjs index 5ce7336..d6a8261 100644 --- a/tests/link-coverage.test.mjs +++ b/tests/link-coverage.test.vitest.mjs @@ -1,10 +1,10 @@ /** * @Project: @cldmv/git-embedded - * @Filename: /tests/link-coverage.test.mjs + * @Filename: /tests/link-coverage.test.vitest.mjs * @Copyright: Copyright (c) 2013-2026 Catalyzed Motivation Inc. All rights reserved. * * Coverage-completing behavior tests for the link + install-hooks layer, - * complementing tests/install-link.test.mjs and tests/install-hooks.test.mjs. + * complementing tests/install-link.test.vitest.mjs and tests/install-hooks.test.vitest.mjs. * Everything here is driven through the composed slothlet api against REAL * files in temp dirs; the branches that only fire on Windows (privilege-denied * symlink → UAC batch) or on a copy/chmod failure are exercised by: diff --git a/tests/root-coverage.test.mjs b/tests/root-coverage.test.vitest.mjs similarity index 98% rename from tests/root-coverage.test.mjs rename to tests/root-coverage.test.vitest.mjs index 7d1e7b7..599c714 100644 --- a/tests/root-coverage.test.mjs +++ b/tests/root-coverage.test.vitest.mjs @@ -24,12 +24,12 @@ vi.mock("node:readline", () => ({ /** * Coverage top-up for src/api/prompt.mjs, paths.mjs, git.mjs, report.mjs, and * src/api/commander/custom-help.mjs — closing the line/branch/function gaps - * left after tests/helpers.test.mjs and tests/commander-help.test.mjs. + * left after tests/helpers.test.vitest.mjs and tests/commander-help.test.vitest.mjs. * * Same house style as those two files: exercise the composed slothlet api * against real temp git repos / XDG dirs (git.mjs, paths.mjs, report.mjs), * and a real commander Command tree through the directly-imported - * custom-help.mjs factory (matching commander-help.test.mjs's pattern). + * custom-help.mjs factory (matching commander-help.test.vitest.mjs's pattern). * prompt.mjs is the one exception that needs the readline module mock above * to drive its interactive path deterministically. */ @@ -232,7 +232,7 @@ describe("api.report.detectionHeader — edge cases", () => { // --------------------------------------------------------------------------- // src/api/commander/custom-help.mjs — remaining branches -// (direct-import style, matching tests/commander-help.test.mjs) +// (direct-import style, matching tests/commander-help.test.vitest.mjs) // --------------------------------------------------------------------------- function buildCustomHelp() { diff --git a/tests/run-vitest.mjs b/tests/run-vitest.mjs index f46fd4e..92a9c27 100644 --- a/tests/run-vitest.mjs +++ b/tests/run-vitest.mjs @@ -42,8 +42,8 @@ const code = await run({ cwd: root, testDir: "tests", vitestConfig: ".configs/vitest.config.mjs", - // git-embedded uses the plain `*.test.mjs` convention rather than `*.test.vitest.mjs`. - testFilePattern: /\.test\.mjs$/, + // CLDMV standing convention: vitest test files are always named `*.test.vitest.mjs`. + testFilePattern: /\.test\.vitest\.mjs$/, testPatterns, workers, coverageQuiet, From e18dc5d4d29f5bba73d1e5b39fb4e6721203ba4f Mon Sep 17 00:00:00 2001 From: "cldmv-bot[bot]" <230771808+cldmv-bot[bot]@users.noreply.github.com> Date: Mon, 3 Aug 2026 06:28:14 +0000 Subject: [PATCH 2/2] chore: bump version to 1.1.4 --- package-lock.json | 4 ++-- package.json | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/package-lock.json b/package-lock.json index 35c4e0e..7f2e35a 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "@cldmv/git-embedded", - "version": "1.1.3", + "version": "1.1.4", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "@cldmv/git-embedded", - "version": "1.1.3", + "version": "1.1.4", "license": "Apache-2.0", "dependencies": { "@cldmv/slothlet": "^3.7.0", diff --git a/package.json b/package.json index 43a0b09..4b1ad93 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@cldmv/git-embedded", - "version": "1.1.3", + "version": "1.1.4", "description": "Manage embedded git repositories (anonymous gitlinks) without .gitmodules. Provides hooks that restore standard git-command ergonomics for embedded children while keeping the child's origin URL out of the public parent repo.", "type": "module", "license": "Apache-2.0",