fix: force os to linux in tests
This commit is contained in:
parent
d6a9bae48d
commit
b9ea3c81c6
3 changed files with 12 additions and 3 deletions
|
|
@ -1,4 +1,4 @@
|
|||
import { expect, test } from "vitest";
|
||||
import { expect, test, vi } from "vitest";
|
||||
import * as nlk from "../dist/index.js";
|
||||
import path from "path";
|
||||
import fs from "fs/promises";
|
||||
|
|
@ -16,6 +16,9 @@ async function exists(path: string) {
|
|||
}
|
||||
}
|
||||
|
||||
// mock os to linux for testing
|
||||
vi.stubGlobal("process", { platform: "linux" });
|
||||
|
||||
test("install java-runtime-beta for linux correctly", {timeout: 10000}, async () => {
|
||||
await nlk.core.java.download("linux", "java-runtime-beta", javaPath);
|
||||
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
import { expect, test } from "vitest";
|
||||
import { expect, test, vi } from "vitest";
|
||||
import * as nlk from "../dist/index.js";
|
||||
import path from "path";
|
||||
import fs from "fs/promises";
|
||||
|
|
@ -16,6 +16,9 @@ async function exists(path: string) {
|
|||
}
|
||||
}
|
||||
|
||||
// mock os to linux for testing
|
||||
vi.stubGlobal("process", { platform: "linux" });
|
||||
|
||||
test(
|
||||
"download libraries for 1.21.8 correctly",
|
||||
{ timeout: 10000 },
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
import { expect, test } from "vitest";
|
||||
import { expect, test, vi } from "vitest";
|
||||
import * as nlk from "../dist/index.js";
|
||||
import path from "path";
|
||||
import fs from "fs/promises";
|
||||
|
|
@ -16,6 +16,9 @@ async function exists(path: string) {
|
|||
}
|
||||
}
|
||||
|
||||
// mock os to linux for testing
|
||||
vi.stubGlobal("process", { platform: "linux" });
|
||||
|
||||
// old version because newer versions doesn't have natives
|
||||
test("download natives for 1.15 correctly", { timeout: 10000 }, async () => {
|
||||
const versionManifest = await nlk.core.version.getVersionManifest("1.15");
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue