test: verify Korean project path support

This commit is contained in:
2026-08-13 09:57:27 +09:00
parent 2f0699d795
commit b57a80814f
4 changed files with 37 additions and 7 deletions

4
package-lock.json generated
View File

@@ -1,12 +1,12 @@
{
"name": "@kri/create-next-app",
"version": "0.1.3",
"version": "0.1.5",
"lockfileVersion": 3,
"requires": true,
"packages": {
"": {
"name": "@kri/create-next-app",
"version": "0.1.3",
"version": "0.1.5",
"license": "UNLICENSED",
"bin": {
"kri-create-next-app": "dist/cli.js"

View File

@@ -1,6 +1,6 @@
{
"name": "@kri/create-next-app",
"version": "0.1.4",
"version": "0.1.5",
"description": "Create a KRI standard Next.js application",
"type": "module",
"bin": {

View File

@@ -8,9 +8,9 @@ import { parseArguments } from "../dist/args.js";
import { composeAgentHarness } from "../dist/harness.js";
async function createFixture(t) {
const root = await mkdtemp(path.join(os.tmpdir(), "kri-create-next-harness-"));
const harnessRoot = path.join(root, "_________AgentHarnessBase");
const targetDir = path.join(root, "sample-front");
const root = await mkdtemp(path.join(os.tmpdir(), "kri-create-next-한글 공백-"));
const harnessRoot = path.join(root, "_________Agent Harness 기준");
const targetDir = path.join(root, "샘플 front");
const logPath = path.join(root, "calls.jsonl");
await mkdir(path.join(harnessRoot, "dist"), { recursive: true });
await mkdir(targetDir, { recursive: true });
@@ -52,7 +52,7 @@ test("registers shared, composes, and verifies in deterministic order", async (t
.split("\n")
.map((line) => JSON.parse(line));
assert.deepEqual(calls, [
["register", "--project", "sample-front", "--path", "sample-front", "--shared"],
["register", "--project", "sample-front", "--path", "샘플 front", "--shared"],
["compose", "--project", "sample-front"],
["verify", "--project", "sample-front"],
]);

View File

@@ -0,0 +1,30 @@
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);
});