21 lines
511 B
TypeScript
21 lines
511 B
TypeScript
import { describe, expect, it } from "vitest";
|
|
|
|
import { parseLaunchctlPrint } from "./launchd.js";
|
|
|
|
describe("launchd runtime parsing", () => {
|
|
it("parses state, pid, and exit status", () => {
|
|
const output = [
|
|
"state = running",
|
|
"pid = 4242",
|
|
"last exit status = 1",
|
|
"last exit reason = exited",
|
|
].join("\n");
|
|
expect(parseLaunchctlPrint(output)).toEqual({
|
|
state: "running",
|
|
pid: 4242,
|
|
lastExitStatus: 1,
|
|
lastExitReason: "exited",
|
|
});
|
|
});
|
|
});
|