mirror of
https://github.com/zuiidea/antd-admin
synced 2026-10-21 15:04:26 +00:00
test(create): integration test for transforms without network
Made-with: Cursor
This commit is contained in:
@@ -0,0 +1,5 @@
|
||||
{
|
||||
"name": "template-placeholder",
|
||||
"version": "0.0.0",
|
||||
"private": true
|
||||
}
|
||||
@@ -0,0 +1,26 @@
|
||||
import fs from "node:fs";
|
||||
import os from "node:os";
|
||||
import path from "node:path";
|
||||
import { fileURLToPath } from "node:url";
|
||||
import { describe, expect, it } from "vitest";
|
||||
import { runTransforms } from "../transforms/run-transforms.js";
|
||||
|
||||
describe("create pipeline transforms", () => {
|
||||
it("renames package.json", async () => {
|
||||
const tmp = fs.mkdtempSync(path.join(os.tmpdir(), "cad-"));
|
||||
const fixture = path.join(
|
||||
path.dirname(fileURLToPath(import.meta.url)),
|
||||
"../../fixtures/minimal-app"
|
||||
);
|
||||
fs.cpSync(fixture, tmp, { recursive: true });
|
||||
await runTransforms({
|
||||
projectRoot: tmp,
|
||||
packageName: "my-fine-app",
|
||||
skip: false,
|
||||
});
|
||||
const pkg = JSON.parse(
|
||||
fs.readFileSync(path.join(tmp, "package.json"), "utf8")
|
||||
);
|
||||
expect(pkg.name).toBe("my-fine-app");
|
||||
});
|
||||
});
|
||||
Reference in New Issue
Block a user