import assert from "node:assert/strict"; import { mkdtemp, mkdir, readFile, rm, writeFile } from "node:fs/promises"; import os from "node:os"; import path from "node:path"; import test from "node:test"; import { run } from "../dist/process.js"; test("runs npm scripts from a Korean path containing spaces", async (t) => { const root = await mkdtemp(path.join(os.tmpdir(), "kri-create-next-한글 공백-")); const targetDir = path.join(root, "생성 프로젝트"); const markerName = "실행 결과.txt"; await mkdir(targetDir, { recursive: true }); await writeFile( path.join(targetDir, "package.json"), `${JSON.stringify({ name: "unicode-path-check", private: true, scripts: { "path-check": `node -e "require('node:fs').writeFileSync('${markerName}', process.cwd(), 'utf8')"`, }, }, null, 2)}\n`, "utf8", ); t.after(() => rm(root, { recursive: true, force: true })); await run("npm", ["run", "path-check"], targetDir); assert.equal(await readFile(path.join(targetDir, markerName), "utf8"), targetDir); });