Skip to content

Commit

Permalink
fix: ipc-tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Mastercuber committed Mar 22, 2024
1 parent cdaafbe commit 0b06e49
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions test/index.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ function ipcRequest(ipcSocket: string, path: string, https = false) {
});
res.on("end", () => {
try {
resolve(JSON.parse(data.join("")));
resolve(JSON.parse(data));
} catch {
resolve(data.join(""));
}
Expand Down Expand Up @@ -88,9 +88,11 @@ describe("listhen", () => {
await expect(ipcRequest(ipcSocket, "/unix", https)).resolves.toEqual({
hello: "unix!",
});
await expect(ipcRequest(ipcSocket, "/test", https)).resolves.toContain({
statusCode: 404,
});
const response = await ipcRequest(ipcSocket, "/test", https);
expect(response.statusCode).toEqual(404);
expect(response.statusMessage).toEqual(
"Cannot find any path matching /test.",
);
}

async function handleAssertions(ipcSocket: string, https: boolean) {
Expand Down

0 comments on commit 0b06e49

Please sign in to comment.