agent-gear 2.9.0 → 2.10.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/AGENTS.md +25 -5
- package/dist/acp/bridge.d.ts +29 -1
- package/dist/acp/bridge.d.ts.map +1 -1
- package/dist/acp/bridge.js +171 -27
- package/dist/acp/bridge.js.map +1 -1
- package/dist/acp/bridge.test.js +198 -15
- package/dist/acp/bridge.test.js.map +1 -1
- package/dist/acp/initial-config.integration.test.d.ts +2 -0
- package/dist/acp/initial-config.integration.test.d.ts.map +1 -0
- package/dist/acp/initial-config.integration.test.js +95 -0
- package/dist/acp/initial-config.integration.test.js.map +1 -0
- package/dist/cloud-host/supervisor.d.ts +8 -19
- package/dist/cloud-host/supervisor.d.ts.map +1 -1
- package/dist/cloud-host/supervisor.js +7 -27
- package/dist/cloud-host/supervisor.js.map +1 -1
- package/dist/cloud-host/supervisor.test.js +12 -6
- package/dist/cloud-host/supervisor.test.js.map +1 -1
- package/dist/exit-codes.d.ts +30 -0
- package/dist/exit-codes.d.ts.map +1 -0
- package/dist/exit-codes.js +52 -0
- package/dist/exit-codes.js.map +1 -0
- package/dist/exit-codes.test.d.ts +2 -0
- package/dist/exit-codes.test.d.ts.map +1 -0
- package/dist/exit-codes.test.js +61 -0
- package/dist/exit-codes.test.js.map +1 -0
- package/dist/harness/env.test.js +2 -2
- package/dist/harness/env.test.js.map +1 -1
- package/dist/harness/prepare.test.js +2 -2
- package/dist/harness/prepare.test.js.map +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -0
- package/dist/index.js.map +1 -1
- package/dist/socketio-client.auth-gate.test.js +3 -3
- package/dist/socketio-client.auth-gate.test.js.map +1 -1
- package/dist/socketio-client.d.ts.map +1 -1
- package/dist/socketio-client.js +27 -3
- package/dist/socketio-client.js.map +1 -1
- package/dist/socketio-client.test.js +37 -0
- package/dist/socketio-client.test.js.map +1 -1
- package/dist/workload-executor.test.js +2 -2
- package/dist/workload-executor.test.js.map +1 -1
- package/package.json +1 -1
- package/src/acp/__fixtures__/fake-initial-config-agent.mjs +113 -0
- package/src/acp/bridge.test.ts +223 -15
- package/src/acp/bridge.ts +188 -27
- package/src/acp/initial-config.integration.test.ts +120 -0
- package/src/cloud-host/supervisor.test.ts +15 -6
- package/src/cloud-host/supervisor.ts +22 -35
- package/src/exit-codes.test.ts +73 -0
- package/src/exit-codes.ts +59 -0
- package/src/harness/env.test.ts +2 -2
- package/src/harness/prepare.test.ts +2 -2
- package/src/index.ts +7 -0
- package/src/socketio-client.auth-gate.test.ts +3 -3
- package/src/socketio-client.test.ts +44 -0
- package/src/socketio-client.ts +27 -3
- package/src/workload-executor.test.ts +2 -2
- package/tests/commands/harness.test.ts +1 -1
- package/tests/socketio-client.test.ts +5 -4
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 进程退出码分类(契约 `agent-controller-websocket.md` §3.7)。
|
|
3
|
+
*
|
|
4
|
+
* 三分口径:
|
|
5
|
+
* - `42` 服务端终止(`unregistered` / 非失败类 `shutdown` / `error: INVALID_TOKEN`)→ 入口不重启;
|
|
6
|
+
* - `0` 自发 / 信号退出(`SIGINT` / `SIGTERM`)→ 入口保活重启(误杀恢复);
|
|
7
|
+
* - `1` 失败类(`version_mismatch:*` / 其它 `error:*` / 初始化失败)→ 入口退避自更新后重启。
|
|
8
|
+
*
|
|
9
|
+
* `socketio-client.ts` 与 `cloud-host/supervisor.ts` 共用本模块,避免两者循环依赖。
|
|
10
|
+
*/
|
|
11
|
+
|
|
12
|
+
/** 服务端终止退出码:容器入口视为正常结束、不重启。 */
|
|
13
|
+
export const EXIT_SERVER_SHUTDOWN = 42;
|
|
14
|
+
|
|
15
|
+
/** 信号类退出码:入口保活重启。 */
|
|
16
|
+
export const EXIT_SIGNAL_SHUTDOWN = 0;
|
|
17
|
+
|
|
18
|
+
/** 失败类退出码:入口退避自更新后重启。 */
|
|
19
|
+
export const EXIT_FAILURE_SHUTDOWN = 1;
|
|
20
|
+
|
|
21
|
+
/**
|
|
22
|
+
* 错误/失败类 reason 判定(自 supervisor 逐字迁移,语义不得变更)。
|
|
23
|
+
*/
|
|
24
|
+
export function isFailureShutdownReason(reason: string): boolean {
|
|
25
|
+
const normalized = reason.trim().toLowerCase();
|
|
26
|
+
if (normalized.includes('version_mismatch:') || /(^|[\s:])error:/.test(normalized)) {
|
|
27
|
+
return true;
|
|
28
|
+
}
|
|
29
|
+
return (
|
|
30
|
+
reason.includes('初始化失败') ||
|
|
31
|
+
normalized.includes('init failed') ||
|
|
32
|
+
normalized.includes('initialization failed')
|
|
33
|
+
);
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
/** 信号终止 reason(允许 `signal: SIGTERM` 形态)。 */
|
|
37
|
+
export function isSignalShutdownReason(reason: string): boolean {
|
|
38
|
+
return /(^|[\s:])(sigint|sigterm)\s*$/i.test(reason.trim());
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
/** 服务端终止 reason(42):`unregistered` 或 `error: INVALID_TOKEN`(可带包装前缀)。 */
|
|
42
|
+
export function isServerTerminationReason(reason: string): boolean {
|
|
43
|
+
const normalized = reason.trim().toLowerCase();
|
|
44
|
+
return (
|
|
45
|
+
normalized.includes('unregistered') ||
|
|
46
|
+
/(^|[\s:])error:\s*invalid_token\b/.test(normalized)
|
|
47
|
+
);
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
/**
|
|
51
|
+
* 由 reason 推导退出码:信号 0 → 服务端终止 42 → 失败 1 → 其余 42。
|
|
52
|
+
* 判定顺序保证 `INVALID_TOKEN`(虽匹配 `error:`)归 42。
|
|
53
|
+
*/
|
|
54
|
+
export function resolveShutdownExitCode(reason: string): number {
|
|
55
|
+
if (isSignalShutdownReason(reason)) return EXIT_SIGNAL_SHUTDOWN;
|
|
56
|
+
if (isServerTerminationReason(reason)) return EXIT_SERVER_SHUTDOWN;
|
|
57
|
+
if (isFailureShutdownReason(reason)) return EXIT_FAILURE_SHUTDOWN;
|
|
58
|
+
return EXIT_SERVER_SHUTDOWN;
|
|
59
|
+
}
|
package/src/harness/env.test.ts
CHANGED
|
@@ -11,7 +11,7 @@ const VALID_ENV: NodeJS.ProcessEnv = {
|
|
|
11
11
|
ZAG_MODEL_BASE_URL: 'http://admin-api:8002/v1',
|
|
12
12
|
ZAG_MODEL_API_KEY: 'zag_sk_super_secret',
|
|
13
13
|
ZAG_MODEL_IDS: '["model-a","model-b"]',
|
|
14
|
-
ZAG_DEFAULT_WORKSPACE: '/
|
|
14
|
+
ZAG_DEFAULT_WORKSPACE: '/home/worker/workspace',
|
|
15
15
|
};
|
|
16
16
|
|
|
17
17
|
describe('readHarnessEnv (T-AG7/T-AG11)', () => {
|
|
@@ -21,7 +21,7 @@ describe('readHarnessEnv (T-AG7/T-AG11)', () => {
|
|
|
21
21
|
modelApiKey: 'zag_sk_super_secret',
|
|
22
22
|
modelIds: ['model-a', 'model-b'],
|
|
23
23
|
modelContextLengths: {},
|
|
24
|
-
defaultWorkspace: '/
|
|
24
|
+
defaultWorkspace: '/home/worker/workspace',
|
|
25
25
|
});
|
|
26
26
|
});
|
|
27
27
|
|
|
@@ -14,7 +14,7 @@ const VALID_ENV: NodeJS.ProcessEnv = {
|
|
|
14
14
|
ZAG_MODEL_BASE_URL: 'http://admin-api:8002/v1',
|
|
15
15
|
ZAG_MODEL_API_KEY: 'zag_sk_super_secret',
|
|
16
16
|
ZAG_MODEL_IDS: '["model-a","model-a"," model-b ",""]',
|
|
17
|
-
ZAG_DEFAULT_WORKSPACE: '/
|
|
17
|
+
ZAG_DEFAULT_WORKSPACE: '/home/worker/workspace',
|
|
18
18
|
};
|
|
19
19
|
|
|
20
20
|
async function makeDir(): Promise<string> {
|
|
@@ -135,7 +135,7 @@ describe('prepareHarness (T-AG7..T-AG12)', () => {
|
|
|
135
135
|
expect(summary).toContain('Harness prepared: types=opencode');
|
|
136
136
|
expect(summary).toContain('- opencode: version=1.2.3');
|
|
137
137
|
expect(summary).toContain('models=2');
|
|
138
|
-
expect(summary).toContain('workspace=/
|
|
138
|
+
expect(summary).toContain('workspace=/home/worker/workspace');
|
|
139
139
|
expect(summary).not.toContain('zag_sk_super_secret');
|
|
140
140
|
expect(summary).not.toContain('admin-api');
|
|
141
141
|
});
|
package/src/index.ts
CHANGED
|
@@ -10,6 +10,13 @@ import { startMcpProxy } from './commands/mcp.js';
|
|
|
10
10
|
import { registerHarnessCommands } from './commands/harness.js';
|
|
11
11
|
import { isCloudHostMode, startCloudHostSupervisor } from './cloud-host/supervisor.js';
|
|
12
12
|
import { processRegistry, isProcessAlive } from './acp/process-registry.js';
|
|
13
|
+
export {
|
|
14
|
+
EXIT_SERVER_SHUTDOWN,
|
|
15
|
+
isFailureShutdownReason,
|
|
16
|
+
isServerTerminationReason,
|
|
17
|
+
isSignalShutdownReason,
|
|
18
|
+
resolveShutdownExitCode,
|
|
19
|
+
} from './exit-codes.js';
|
|
13
20
|
|
|
14
21
|
// 版本号唯一事实源为 package.json(`--version` 与 npm 发布版本保持一致,避免手工同步漂移)。
|
|
15
22
|
const { version: CLI_VERSION } = createRequire(import.meta.url)('../package.json') as {
|
|
@@ -75,11 +75,11 @@ function emitted(event: string) {
|
|
|
75
75
|
}
|
|
76
76
|
|
|
77
77
|
describe('CONTROLLER_VERSION', () => {
|
|
78
|
-
it('register 上报版本取自 package.json
|
|
78
|
+
it('register 上报版本取自 package.json(无第二处常量)', () => {
|
|
79
79
|
setup();
|
|
80
80
|
fake.handlers.get('connect')?.();
|
|
81
|
-
expect(PACKAGE_VERSION).
|
|
82
|
-
expect(emitted('register')[0]).toMatchObject({ version:
|
|
81
|
+
expect(PACKAGE_VERSION).toMatch(/^\d+\.\d+\.\d+/);
|
|
82
|
+
expect(emitted('register')[0]).toMatchObject({ version: PACKAGE_VERSION });
|
|
83
83
|
});
|
|
84
84
|
});
|
|
85
85
|
|
|
@@ -184,6 +184,50 @@ describe('cloud-host reconnect backoff (C-3)', () => {
|
|
|
184
184
|
});
|
|
185
185
|
});
|
|
186
186
|
|
|
187
|
+
describe('idle-path exit codes (contract §3.7)', () => {
|
|
188
|
+
beforeEach(() => {
|
|
189
|
+
fake.handlers.clear();
|
|
190
|
+
fake.socket.on.mockClear();
|
|
191
|
+
fake.socket.emit.mockClear();
|
|
192
|
+
fake.socket.disconnect.mockClear();
|
|
193
|
+
fake.socket.close.mockClear();
|
|
194
|
+
vi.spyOn(console, 'log').mockImplementation(() => {});
|
|
195
|
+
vi.spyOn(console, 'error').mockImplementation(() => {});
|
|
196
|
+
vi.spyOn(process, 'exit').mockImplementation(((code?: number) => {
|
|
197
|
+
throw new Error(`exit:${code}`);
|
|
198
|
+
}) as never);
|
|
199
|
+
});
|
|
200
|
+
|
|
201
|
+
afterEach(() => {
|
|
202
|
+
vi.restoreAllMocks();
|
|
203
|
+
});
|
|
204
|
+
|
|
205
|
+
it('unregistered exits 42 (server termination)', () => {
|
|
206
|
+
setup(false);
|
|
207
|
+
expect(() => fake.handlers.get('unregistered')?.()).toThrow('exit:42');
|
|
208
|
+
});
|
|
209
|
+
|
|
210
|
+
it('server shutdown exits 42, failure shutdown exits 1', () => {
|
|
211
|
+
setup(false);
|
|
212
|
+
expect(() => shutdownHandler()({ reason: 'server requested shutdown' })).toThrow('exit:42');
|
|
213
|
+
|
|
214
|
+
fake.handlers.clear();
|
|
215
|
+
setup(false);
|
|
216
|
+
expect(() => shutdownHandler()({ reason: 'error: REGISTER_FAILED' })).toThrow('exit:1');
|
|
217
|
+
});
|
|
218
|
+
|
|
219
|
+
it('error INVALID_TOKEN exits 42 instead of the generic failure code', () => {
|
|
220
|
+
setup(false);
|
|
221
|
+
expect(() => errorHandler()({ code: 'INVALID_TOKEN', message: 'token expired' })).toThrow('exit:42');
|
|
222
|
+
});
|
|
223
|
+
|
|
224
|
+
it('connect_error INVALID_TOKEN exits 42', () => {
|
|
225
|
+
setup(false);
|
|
226
|
+
const error = Object.assign(new Error('INVALID_TOKEN'), { data: { code: 'INVALID_TOKEN' } });
|
|
227
|
+
expect(() => fake.handlers.get('connect_error')?.(error)).toThrow('exit:42');
|
|
228
|
+
});
|
|
229
|
+
});
|
|
230
|
+
|
|
187
231
|
describe('buildAcpInitResult', () => {
|
|
188
232
|
it('T-SC1: payload 带 capabilities 时透传,既有字段一个不少', () => {
|
|
189
233
|
const capabilities = {
|
package/src/socketio-client.ts
CHANGED
|
@@ -21,10 +21,11 @@ import { processRegistry, isProcessAlive } from './acp/process-registry.js';
|
|
|
21
21
|
import { McpRelay } from './mcp/relay.js';
|
|
22
22
|
import { LocalMcpServer } from './mcp/local-server.js';
|
|
23
23
|
import { WorkloadExecutor, type WorkloadRunPayload, collectSecretValues, redactSecrets } from './workload-executor.js';
|
|
24
|
+
import { EXIT_SERVER_SHUTDOWN, resolveShutdownExitCode } from './exit-codes.js';
|
|
24
25
|
|
|
25
26
|
// 版本号唯一事实源为 package.json(register 上报的完整版本;服务端按 MIN_WORKER_VERSION=2.2.0 门禁)。
|
|
26
27
|
// 2.8.0 起 `kimi_code` 使用前登录闸门(`kimi login` stdio 判定 + `harness:login:*` 事件族);
|
|
27
|
-
// 2.6.0 起支持 `workload:run.githubAuth` 与云电脑 Github 凭据管理器(MIN_HARNESS_WORKER_VERSION=2.
|
|
28
|
+
// 2.6.0 起支持 `workload:run.githubAuth` 与云电脑 Github 凭据管理器(MIN_HARNESS_WORKER_VERSION=2.10.0);
|
|
28
29
|
// 2.5.0 起支持云电脑双连接(`/worker` + controller-api)与 `harness prepare`。
|
|
29
30
|
const { version: CONTROLLER_VERSION } = createRequire(import.meta.url)('../package.json') as {
|
|
30
31
|
version: string;
|
|
@@ -527,6 +528,17 @@ export function connectToServer(
|
|
|
527
528
|
|
|
528
529
|
socket.on('error', (data: ErrorPayload) => {
|
|
529
530
|
console.error(`Server error: ${data.code} - ${data.message}`);
|
|
531
|
+
if (data.code === 'INVALID_TOKEN') {
|
|
532
|
+
// token 已失效 = 已被服务端注销:服务端终止语义(退出码 42,入口不保活重启)。
|
|
533
|
+
console.error('Handshake token is no longer valid; the container has been deregistered.');
|
|
534
|
+
socket.disconnect();
|
|
535
|
+
if (options?.onShutdown) {
|
|
536
|
+
notifyShutdown({ reason: `error: ${data.code}` });
|
|
537
|
+
return;
|
|
538
|
+
}
|
|
539
|
+
process.exit(EXIT_SERVER_SHUTDOWN);
|
|
540
|
+
return;
|
|
541
|
+
}
|
|
530
542
|
if (data.code === 'VERSION_MISMATCH') {
|
|
531
543
|
console.error('The agent-controller version is not supported by the server.');
|
|
532
544
|
console.error('Please upgrade agent-controller to 2.x (npm i -g agent-gear@2 or the matching release).');
|
|
@@ -569,7 +581,7 @@ export function connectToServer(
|
|
|
569
581
|
return;
|
|
570
582
|
}
|
|
571
583
|
socket.close();
|
|
572
|
-
process.exit(
|
|
584
|
+
process.exit(EXIT_SERVER_SHUTDOWN);
|
|
573
585
|
});
|
|
574
586
|
|
|
575
587
|
socket.on('shutdown', (data: ShutdownPayload) => {
|
|
@@ -585,7 +597,8 @@ export function connectToServer(
|
|
|
585
597
|
}
|
|
586
598
|
if (persistConfig) clearConfigKey();
|
|
587
599
|
socket.close();
|
|
588
|
-
|
|
600
|
+
// idle / 单连接:服务端终止 42、失败类 1(与云电脑 supervisor 同一分类)。
|
|
601
|
+
process.exit(resolveShutdownExitCode(data.reason));
|
|
589
602
|
};
|
|
590
603
|
// post 批次仍在执行时,等待其结束(≤5s)后再退出,避免清理脚本被中途打断。
|
|
591
604
|
// 无批次在跑时保持同步退出,行为与现状完全一致。
|
|
@@ -1477,6 +1490,17 @@ export function connectToServer(
|
|
|
1477
1490
|
// 传输层失败时 err.message 往往只有笼统的 "websocket error",真实原因在 description/context
|
|
1478
1491
|
// (如 HTTP 404/502、TLS 失败、协议错误)里——一并打印,避免"看不出为何连不上"。
|
|
1479
1492
|
console.error(`Connection error: ${err.message}${describeConnectError(err)}`);
|
|
1493
|
+
// 握手鉴权失败(cloud-controller 一次性 token 已失效):服务端终止语义,退出码 42。
|
|
1494
|
+
const code = (err as Error & { data?: { code?: string } }).data?.code;
|
|
1495
|
+
if (code === 'INVALID_TOKEN' || err.message.includes('INVALID_TOKEN')) {
|
|
1496
|
+
console.error('Handshake token is no longer valid; the container has been deregistered.');
|
|
1497
|
+
socket.disconnect();
|
|
1498
|
+
if (options?.onShutdown) {
|
|
1499
|
+
notifyShutdown({ reason: 'error: INVALID_TOKEN' });
|
|
1500
|
+
return;
|
|
1501
|
+
}
|
|
1502
|
+
process.exit(EXIT_SERVER_SHUTDOWN);
|
|
1503
|
+
}
|
|
1480
1504
|
});
|
|
1481
1505
|
|
|
1482
1506
|
return socket;
|
|
@@ -570,7 +570,7 @@ describe('WorkloadExecutor container env + secret redaction (T-AG13/T-AG14)', ()
|
|
|
570
570
|
phase: 'init',
|
|
571
571
|
env: {
|
|
572
572
|
ZAG_MODEL_IDS: '["model-a","model-b"]',
|
|
573
|
-
ZAG_DEFAULT_WORKSPACE: '/
|
|
573
|
+
ZAG_DEFAULT_WORKSPACE: '/home/worker/workspace',
|
|
574
574
|
ZAG_USER_ID: 'user-1',
|
|
575
575
|
WORKLOAD_PARAM_VERSION: 'from-container-env',
|
|
576
576
|
},
|
|
@@ -595,7 +595,7 @@ describe('WorkloadExecutor container env + secret redaction (T-AG13/T-AG14)', ()
|
|
|
595
595
|
|
|
596
596
|
expect(results.map((r) => r.logId)).toEqual(['first', 'second']);
|
|
597
597
|
expect(results[0].log).toContain('IDS=["model-a","model-b"]');
|
|
598
|
-
expect(results[0].log).toContain('WS=/
|
|
598
|
+
expect(results[0].log).toContain('WS=/home/worker/workspace');
|
|
599
599
|
expect(results[0].log).toContain('USER=user-1');
|
|
600
600
|
// item 参数优先于容器 env 的同名 WORKLOAD_PARAM_*
|
|
601
601
|
expect(results[0].log).toContain('V=from-item-param');
|
|
@@ -13,7 +13,7 @@ function buildProgram(deps: Parameters<typeof registerHarnessCommands>[1] = {})
|
|
|
13
13
|
const SUCCESS_RESULT: HarnessPrepareResult = {
|
|
14
14
|
env: {
|
|
15
15
|
modelBaseUrl: 'http://admin-api:8002/v1',
|
|
16
|
-
defaultWorkspace: '/
|
|
16
|
+
defaultWorkspace: '/home/worker/workspace',
|
|
17
17
|
modelCount: 2,
|
|
18
18
|
types: ['opencode'],
|
|
19
19
|
},
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { describe, it, expect, vi, beforeEach, afterEach } from 'vitest';
|
|
2
|
+
import { version as PACKAGE_VERSION } from '../package.json';
|
|
2
3
|
|
|
3
4
|
const { mockStart, mockStop, MockHeartbeat } = vi.hoisted(() => {
|
|
4
5
|
const start = vi.fn();
|
|
@@ -229,7 +230,7 @@ describe('SocketIO Client', () => {
|
|
|
229
230
|
expect(mockSocket.emit).toHaveBeenCalledWith('register', {
|
|
230
231
|
key: 'zag_k_1_abc123',
|
|
231
232
|
hostname: 'my-machine',
|
|
232
|
-
version:
|
|
233
|
+
version: PACKAGE_VERSION,
|
|
233
234
|
resumeToken: undefined,
|
|
234
235
|
homeDir: '/home/user',
|
|
235
236
|
platform: 'linux',
|
|
@@ -247,7 +248,7 @@ describe('SocketIO Client', () => {
|
|
|
247
248
|
expect(mockSocket.emit).toHaveBeenCalledWith('register', {
|
|
248
249
|
key: 'zag_k_1_abc123',
|
|
249
250
|
hostname: 'test-machine',
|
|
250
|
-
version:
|
|
251
|
+
version: PACKAGE_VERSION,
|
|
251
252
|
resumeToken: undefined,
|
|
252
253
|
homeDir: '/home/user',
|
|
253
254
|
platform: 'linux',
|
|
@@ -289,7 +290,7 @@ describe('SocketIO Client', () => {
|
|
|
289
290
|
expect(mockStop).toHaveBeenCalled();
|
|
290
291
|
expect(clearConfigKey).toHaveBeenCalled();
|
|
291
292
|
expect(mockSocket.close).toHaveBeenCalled();
|
|
292
|
-
expect(process.exit).toHaveBeenCalledWith(
|
|
293
|
+
expect(process.exit).toHaveBeenCalledWith(42);
|
|
293
294
|
});
|
|
294
295
|
|
|
295
296
|
it('should clear config and exit on shutdown', () => {
|
|
@@ -303,7 +304,7 @@ describe('SocketIO Client', () => {
|
|
|
303
304
|
expect(mockStop).toHaveBeenCalled();
|
|
304
305
|
expect(clearConfigKey).toHaveBeenCalled();
|
|
305
306
|
expect(mockSocket.close).toHaveBeenCalled();
|
|
306
|
-
expect(process.exit).toHaveBeenCalledWith(
|
|
307
|
+
expect(process.exit).toHaveBeenCalledWith(42);
|
|
307
308
|
});
|
|
308
309
|
|
|
309
310
|
it('should stop heartbeat on disconnect', () => {
|