From 6b353605120b737ca7db823c95bd3f1a441e5538 Mon Sep 17 00:00:00 2001 From: Sunn Yao Date: Sat, 29 Jun 2024 20:55:30 +0800 Subject: [PATCH] Update unit test for vmess/vless TCP --- src/utils/__tests__/singbox.test.ts | 26 ++++++++++++++++++++++++-- 1 file changed, 24 insertions(+), 2 deletions(-) diff --git a/src/utils/__tests__/singbox.test.ts b/src/utils/__tests__/singbox.test.ts index 570e45158..a5d7d785d 100644 --- a/src/utils/__tests__/singbox.test.ts +++ b/src/utils/__tests__/singbox.test.ts @@ -123,7 +123,7 @@ const nodeList: ReadonlyArray = [ mux: true, }, { - nodeName: 'vmess.tcpNotSupported', + nodeName: 'vmess.tcp', type: NodeTypeEnum.Vmess, hostname: 'example.com', port: 443, @@ -261,7 +261,7 @@ const nodeList: ReadonlyArray = [ }, }, { - nodeName: 'vless.tcpNotSupported', + nodeName: 'vless.tcp', type: NodeTypeEnum.Vless, hostname: 'example.com', port: 443, @@ -668,6 +668,15 @@ const expectedNodes: Record[] = [ plugin: 'v2ray-plugin', plugin_opts: 'host=example.com;mode=quic;path=/obfs;tls=true', }, + { + type: 'vmess', + tag: 'vmess.tcp', + server: 'example.com', + server_port: 443, + security: 'auto', + uuid: '1386f85e-657b-4d6e-9d56-78badb75e1fd', + alter_id: 0, + }, { type: 'vmess', tag: 'vmess.complex', @@ -759,6 +768,19 @@ const expectedNodes: Record[] = [ headers: { Host: ['example.com'] }, }, }, + { + type: 'vless', + tag: 'vless.tcp', + server: 'example.com', + server_port: 443, + uuid: '1386f85e-657b-4d6e-9d56-78badb75e1fd', + flow: 'xtls-rprx-vision', + tls: { + enabled: true, + utls: { enabled: true, fingerprint: 'chrome2' }, + reality: { enabled: true, public_key: 'publicKey', short_id: 'shortId' }, + }, + }, { type: 'vless', tag: 'vless.complex',