mirror of
https://github.com/lensapp/lens.git
synced 2025-05-20 05:10:56 +00:00
Fix tests
Signed-off-by: Sebastian Malton <sebastian@malton.name>
This commit is contained in:
parent
cd0a68c347
commit
3d860cb036
@ -123,7 +123,7 @@ export enum ClusterStatus {
|
||||
}
|
||||
|
||||
/**
|
||||
* The message format for the "kube-auth:<cluster-id>" channels
|
||||
* The message format for the "cluster:<cluster-id>:connection-update" channels
|
||||
*/
|
||||
export interface KubeAuthUpdate {
|
||||
message: string;
|
||||
|
||||
@ -177,34 +177,34 @@ describe("kube auth proxy tests", () => {
|
||||
await proxy.run();
|
||||
listeners["error"]({ message: "foobarbat" });
|
||||
|
||||
expect(mockBroadcastIpc).toBeCalledWith("kube-auth:foobar", { data: "foobarbat", error: true });
|
||||
expect(mockBroadcastIpc).toBeCalledWith("cluster:foobar:connection-update", { data: "foobarbat", error: true });
|
||||
});
|
||||
|
||||
it("should call spawn and broadcast exit", async () => {
|
||||
await proxy.run();
|
||||
listeners["exit"](0);
|
||||
|
||||
expect(mockBroadcastIpc).toBeCalledWith("kube-auth:foobar", { data: "proxy exited with code: 0", error: false });
|
||||
expect(mockBroadcastIpc).toBeCalledWith("cluster:foobar:connection-update", { data: "proxy exited with code: 0", error: false });
|
||||
});
|
||||
|
||||
it("should call spawn and broadcast errors from stderr", async () => {
|
||||
await proxy.run();
|
||||
listeners["stderr/data"]("an error");
|
||||
|
||||
expect(mockBroadcastIpc).toBeCalledWith("kube-auth:foobar", { data: "an error", error: true });
|
||||
expect(mockBroadcastIpc).toBeCalledWith("cluster:foobar:connection-update", { data: "an error", error: true });
|
||||
});
|
||||
|
||||
it("should call spawn and broadcast stdout serving info", async () => {
|
||||
await proxy.run();
|
||||
|
||||
expect(mockBroadcastIpc).toBeCalledWith("kube-auth:foobar", { data: "Authentication proxy started\n" });
|
||||
expect(mockBroadcastIpc).toBeCalledWith("cluster:foobar:connection-update", { data: "Authentication proxy started\n" });
|
||||
});
|
||||
|
||||
it("should call spawn and broadcast stdout other info", async () => {
|
||||
await proxy.run();
|
||||
listeners["stdout/data"]("some info");
|
||||
|
||||
expect(mockBroadcastIpc).toBeCalledWith("kube-auth:foobar", { data: "some info" });
|
||||
expect(mockBroadcastIpc).toBeCalledWith("cluster:foobar:connection-update", { data: "some info" });
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
Loading…
Reference in New Issue
Block a user