11import assert from "node:assert/strict" ;
2- import { mkdtemp , rm } from "node:fs/promises" ;
2+ import { mkdir } from "node:fs/promises" ;
33import path from "node:path" ;
44import test from "node:test" ;
5- import { fileURLToPath } from "node:url" ;
65import { DEFAULT_MINECRAFT_TARGET_VERSION } from "../src/constants.js" ;
76import { resolveLatestCreateMinecraftTargetVersion } from "../src/commands/create.js" ;
87import { 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-
2117type 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
162158test ( "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