[bugfix] fix issue with reading processes in os.helpers.ts in linux

This commit is contained in:
silentrald
2024-12-05 08:48:04 +08:00
parent 127a538509
commit 78fb06fc63
2 changed files with 30 additions and 9 deletions
+8 -2
View File
@@ -196,8 +196,14 @@ ifDescribe(IS_LINUX)("Test os.helpers isProcessRunning", () => {
const running = await isProcessRunning(`bs-manager-${crypto.randomUUID()}`);
expect(running).toBe(false);
// No errors received
expect(logSpy).toHaveBeenCalledTimes(0);
// Throws because grep couldn't find any process with that name
expect(logSpy).toHaveBeenCalledTimes(1);
});
it("Empty process name", async () => {
const running = await isProcessRunning("");
expect(running).toBe(false);
expect(logSpy).toHaveBeenCalledTimes(0);
})
});