diff --git a/src/main/__test__/kube-auth-proxy.test.ts b/src/main/__test__/kube-auth-proxy.test.ts index e7bee67c07..00fe3698f7 100644 --- a/src/main/__test__/kube-auth-proxy.test.ts +++ b/src/main/__test__/kube-auth-proxy.test.ts @@ -30,14 +30,14 @@ jest.mock("tcp-port-used") import { Cluster } from "../cluster" import { KubeAuthProxy } from "../kube-auth-proxy" import { getFreePort } from "../port" -import { broadcastIpc } from "../../common/ipc" +import { broadcastMessage } from "../../common/ipc" import { ChildProcess, spawn, SpawnOptions } from "child_process" import { bundledKubectlPath, Kubectl } from "../kubectl" import { mock, MockProxy } from 'jest-mock-extended'; import { waitUntilUsed } from 'tcp-port-used'; import { Readable } from "stream" -const mockBroadcastIpc = broadcastIpc as jest.MockedFunction +const mockBroadcastIpc = broadcastMessage as jest.MockedFunction const mockSpawn = spawn as jest.MockedFunction const mockWaitUntilUsed = waitUntilUsed as jest.MockedFunction @@ -92,7 +92,7 @@ describe("kube auth proxy tests", () => { await kap.run() listeners["error"]({ message: "foobarbat" }) - expect(mockBroadcastIpc).toBeCalledWith({ channel: "kube-auth:foobar", args: [{ data: "foobarbat", error: true }] }) + expect(mockBroadcastIpc).toBeCalledWith("kube-auth:foobar", { data: "foobarbat", error: true }) }) it("should call spawn and broadcast exit", async () => { @@ -100,7 +100,7 @@ describe("kube auth proxy tests", () => { await kap.run() listeners["exit"](0) - expect(mockBroadcastIpc).toBeCalledWith({ channel: "kube-auth:foobar", args: [{ data: "proxy exited with code: 0", error: false }] }) + expect(mockBroadcastIpc).toBeCalledWith("kube-auth:foobar", { data: "proxy exited with code: 0", error: false }) }) it("should call spawn and broadcast errors from stderr", async () => { @@ -108,7 +108,7 @@ describe("kube auth proxy tests", () => { await kap.run() listeners["stderr/data"]("an error") - expect(mockBroadcastIpc).toBeCalledWith({ channel: "kube-auth:foobar", args: [{ data: "an error", error: true }] }) + expect(mockBroadcastIpc).toBeCalledWith("kube-auth:foobar", { data: "an error", error: true }) }) it("should call spawn and broadcast stdout serving info", async () => { @@ -116,7 +116,7 @@ describe("kube auth proxy tests", () => { await kap.run() listeners["stdout/data"]("Starting to serve on") - expect(mockBroadcastIpc).toBeCalledWith({ channel: "kube-auth:foobar", args: [{ data: "Authentication proxy started\n" }] }) + expect(mockBroadcastIpc).toBeCalledWith("kube-auth:foobar", { data: "Authentication proxy started\n" }) }) it("should call spawn and broadcast stdout other info", async () => { @@ -124,7 +124,7 @@ describe("kube auth proxy tests", () => { await kap.run() listeners["stdout/data"]("some info") - expect(mockBroadcastIpc).toBeCalledWith({ channel: "kube-auth:foobar", args: [{ data: "some info" }] }) + expect(mockBroadcastIpc).toBeCalledWith("kube-auth:foobar", { data: "some info" }) }) }) })