fix(test): add missing getRuntimeMetrics mock to MockSession (#92)
The production code calls connection.session.getRuntimeMetrics() when closing the WebSocket server, but MockSession in the relay-reconnect tests didn't implement this method, causing all close() calls to throw.
This commit is contained in:
@@ -37,6 +37,15 @@ const sessionMock = vi.hoisted(() => {
|
|||||||
handleMessage = vi.fn(async () => {});
|
handleMessage = vi.fn(async () => {});
|
||||||
handleBinaryFrame = vi.fn((_frame: unknown) => {});
|
handleBinaryFrame = vi.fn((_frame: unknown) => {});
|
||||||
getClientActivity = vi.fn(() => null);
|
getClientActivity = vi.fn(() => null);
|
||||||
|
getRuntimeMetrics = vi.fn(() => ({
|
||||||
|
checkoutDiffTargetCount: 0,
|
||||||
|
checkoutDiffSubscriptionCount: 0,
|
||||||
|
checkoutDiffWatcherCount: 0,
|
||||||
|
checkoutDiffFallbackRefreshTargetCount: 0,
|
||||||
|
terminalDirectorySubscriptionCount: 0,
|
||||||
|
terminalSubscriptionCount: 0,
|
||||||
|
terminalStreamCount: 0,
|
||||||
|
}));
|
||||||
readonly args: Record<string, unknown>;
|
readonly args: Record<string, unknown>;
|
||||||
|
|
||||||
constructor(args: Record<string, unknown>) {
|
constructor(args: Record<string, unknown>) {
|
||||||
|
|||||||
Reference in New Issue
Block a user