fix: make modrinth test downloads the java version needed for the pack

This commit is contained in:
HerozDotExe 2026-03-27 12:35:40 +01:00
parent 2cf9f73ce9
commit 3fbb2cdb4b
2 changed files with 15 additions and 12 deletions

View file

@ -16,7 +16,7 @@ test("launch game", { timeout: 0, tags: ["full", "modrinth"] }, async () => {
auth: offlineAuth("player"),
paths: { root: gameRoot, instance: path.join(gameRoot, "instances", "${modpack_id}") },
javaExecutable: "${java}",
ram: {max:"4G",min:"4G"}
ram: { max: "4G", min: "4G" }
},
await importModrinthModpack("${modpack_url}", "url")
);

View file

@ -10,15 +10,18 @@ const gameRoot = path.join(import.meta.dirname, "..", "temp");
test("launch game", { timeout: 0, tags: ["full", "modrinth"] }, async () => {
const javaManager = new RuntimeManager(path.join(gameRoot, "java"));
javaManager.on("progress", console.log)
const java = await javaManager.use(await getJavaComponent("${version}"))
const modpack =
await importModrinthModpack("${modpack_url}", "url")
const java = await javaManager.use(await getJavaComponent(modpack.version))
const instance = new Instance({
auth: offlineAuth("player"),
paths: { root: gameRoot, instance: path.join(gameRoot, "instances", "${modpack_id}") },
javaExecutable: java,
ram: {max:"4G",min:"4G"}
ram: { max: "4G", min: "4G" }
},
await importModrinthModpack("${modpack_url}", "url")
modpack
);
instance.on("progress", console.log);