test(create): vitest and package name normalization

Made-with: Cursor
This commit is contained in:
zuiidea
2026-04-14 22:30:41 +08:00
parent 0185201cbd
commit 831aef8a7b
3 changed files with 46 additions and 0 deletions
@@ -0,0 +1,12 @@
import { describe, expect, it } from "vitest";
import { normalizePackageName } from "./normalize-package-name.js";
describe("normalizePackageName", () => {
it("lowercases and replaces spaces", () => {
expect(normalizePackageName("My App")).toBe("my-app");
});
it("rejects leading dot", () => {
expect(() => normalizePackageName(".bad")).toThrow(/cannot start/);
});
});