Skip to content

Commit

Permalink
Update unit test for vmess/vless TCP
Browse files Browse the repository at this point in the history
  • Loading branch information
cnsunyour committed Jun 29, 2024
1 parent 5e56602 commit 6b35360
Showing 1 changed file with 24 additions and 2 deletions.
26 changes: 24 additions & 2 deletions src/utils/__tests__/singbox.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ const nodeList: ReadonlyArray<PossibleNodeConfigType> = [
mux: true,
},
{
nodeName: 'vmess.tcpNotSupported',
nodeName: 'vmess.tcp',
type: NodeTypeEnum.Vmess,
hostname: 'example.com',
port: 443,
Expand Down Expand Up @@ -261,7 +261,7 @@ const nodeList: ReadonlyArray<PossibleNodeConfigType> = [
},
},
{
nodeName: 'vless.tcpNotSupported',
nodeName: 'vless.tcp',
type: NodeTypeEnum.Vless,
hostname: 'example.com',
port: 443,
Expand Down Expand Up @@ -668,6 +668,15 @@ const expectedNodes: Record<string, any>[] = [
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',
Expand Down Expand Up @@ -759,6 +768,19 @@ const expectedNodes: Record<string, any>[] = [
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',
Expand Down

0 comments on commit 6b35360

Please sign in to comment.