Skip to content

Commit 327cc75

Browse files
committed
fix create.test.ts
1 parent 817809a commit 327cc75

1 file changed

Lines changed: 5 additions & 10 deletions

File tree

packages/blr/test/create.test.ts

Lines changed: 5 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
11
import assert from "node:assert/strict";
2-
import { mkdtemp, rm } from "node:fs/promises";
2+
import { mkdir } from "node:fs/promises";
33
import path from "node:path";
44
import test from "node:test";
5-
import { fileURLToPath } from "node:url";
65
import { DEFAULT_MINECRAFT_TARGET_VERSION } from "../src/constants.js";
76
import { resolveLatestCreateMinecraftTargetVersion } from "../src/commands/create.js";
87
import { exists, listDirectories } from "../src/fs.js";
@@ -15,9 +14,6 @@ import {
1514
runBuiltCli,
1615
} from "./helpers.js";
1716

18-
const testDirectory = path.dirname(fileURLToPath(import.meta.url));
19-
const personalRoot = path.resolve(testDirectory, "..", "..", "..", "..");
20-
2117
type PackageJsonShape = {
2218
dependencies?: Record<string, string>;
2319
devDependencies?: Record<string, string>;
@@ -160,11 +156,10 @@ test("built cli create keeps a resource-only scaffold minimal", async (t) => {
160156
});
161157

162158
test("built cli create uses published semver by default inside the workspace and only switches to file deps with --local-deps", async (t) => {
163-
const workspace = await mkdtemp(
164-
path.join(personalRoot, ".tmp-blr-create-local-"),
165-
);
166-
t.after(async () => {
167-
await rm(workspace, { recursive: true, force: true });
159+
const workspace = await createTempDirectory(t, "blr-create-local-");
160+
await mkdir(path.join(workspace, "bebe"), { recursive: true });
161+
await mkdir(path.join(workspace, "cli", "packages", "blr"), {
162+
recursive: true,
168163
});
169164

170165
const defaultResult = runBuiltCli(

0 commit comments

Comments
 (0)