Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .configs/eslint.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
2 changes: 1 addition & 1 deletion .configs/vitest.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -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",
Expand Down
Original file line number Diff line number Diff line change
@@ -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
Expand Down Expand Up @@ -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`);
Expand Down
Original file line number Diff line number Diff line change
@@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -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:
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -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:
Expand All @@ -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";
Expand Down
Original file line number Diff line number Diff line change
@@ -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
Expand Down
Original file line number Diff line number Diff line change
@@ -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.
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -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
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -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
Expand Down
Original file line number Diff line number Diff line change
@@ -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:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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.
*/
Expand Down Expand Up @@ -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() {
Expand Down
4 changes: 2 additions & 2 deletions tests/run-vitest.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
Loading