import test from "node:test";
import assert from "node:assert/strict";
import { spawnSync } from "node:child_process";

test("CLI greets the provided name", () => {
  const result = spawnSync(process.execPath, ["src/index.mjs", "Codex"], {
    encoding: "utf8",
  });

  assert.equal(result.status, 0);
  assert.match(result.stdout, /Hello, Codex!/);
});
