-
Notifications
You must be signed in to change notification settings - Fork 290
Expand file tree
/
Copy pathinvalidLaunch.test.ts
More file actions
42 lines (37 loc) · 1011 Bytes
/
invalidLaunch.test.ts
File metadata and controls
42 lines (37 loc) · 1011 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
import { describe, expect, test } from "vitest";
import { getJava } from "../testHelpers";
describe("invalidLaunch", () => {
test("callbackNotAFunction", async () => {
await getJava(
{
syncSuffix: "",
promiseSuffix: "P",
},
{
beforeInit: (java) => {
expect(java.isJvmCreated()).toBeFalsy();
expect(() => {
// eslint-disable-next-line @typescript-eslint/no-explicit-any
(java as any).ensureJvm("foo");
}).toThrow(/requires its one argument to be a callback function/);
expect(java.isJvmCreated()).toBeFalsy();
},
}
);
});
test("jvmCanStillBeLaunched", async () => {
await getJava(
{
syncSuffix: "",
promiseSuffix: "P",
},
{
beforeInit: async (java) => {
expect(java.isJvmCreated()).toBeFalsy();
await java.ensureJvm();
expect(java.isJvmCreated()).toBeTruthy();
},
}
);
});
});