rule.test.ts.snap 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091
  1. // Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
  2. exports[`RuleObjectSchema fixtures > parses balancer-routed byte-stably 1`] = `
  3. {
  4. "balancerTag": "balancer-load",
  5. "domain": [
  6. "geosite:geolocation-!cn",
  7. ],
  8. "ruleTag": "outbound-load-balance",
  9. "type": "field",
  10. }
  11. `;
  12. exports[`RuleObjectSchema fixtures > parses full byte-stably 1`] = `
  13. {
  14. "attrs": {
  15. "Host": "example.com",
  16. "User-Agent": "regexp:^Mozilla.*",
  17. },
  18. "domain": [
  19. "domain:google.com",
  20. "full:example.com",
  21. "keyword:cdn",
  22. "regexp:^api\\.example\\.com$",
  23. "geosite:cn",
  24. ],
  25. "inboundTag": [
  26. "inbound-1",
  27. "inbound-2",
  28. ],
  29. "ip": [
  30. "10.0.0.0/8",
  31. "geoip:cn",
  32. "geoip:private",
  33. "!geoip:cn",
  34. ],
  35. "localIP": [
  36. "10.10.10.0/24",
  37. ],
  38. "localPort": "5353",
  39. "network": "tcp,udp",
  40. "outboundTag": "proxy-out",
  41. "port": "80,443,1000-2000",
  42. "process": [
  43. "chrome.exe",
  44. "curl",
  45. "self/",
  46. ],
  47. "protocol": [
  48. "http",
  49. "tls",
  50. "quic",
  51. "bittorrent",
  52. ],
  53. "ruleTag": "main-policy-rule",
  54. "sourceIP": [
  55. "192.168.0.0/16",
  56. "geoip:private",
  57. ],
  58. "sourcePort": "53",
  59. "type": "field",
  60. "user": [
  61. "[email protected]",
  62. "regexp:^.+@admin\\..+$",
  63. ],
  64. "vlessRoute": "443,8443",
  65. "webhook": {
  66. "deduplication": 30,
  67. "headers": {
  68. "X-Auth-Token": "secret",
  69. },
  70. "url": "https://hook.example.com/events",
  71. },
  72. }
  73. `;
  74. exports[`RuleObjectSchema fixtures > parses minimal byte-stably 1`] = `
  75. {
  76. "outboundTag": "direct",
  77. "type": "field",
  78. }
  79. `;
  80. exports[`RuleObjectSchema fixtures > parses port-number byte-stably 1`] = `
  81. {
  82. "network": "tcp",
  83. "outboundTag": "tls-out",
  84. "port": 443,
  85. "type": "field",
  86. }
  87. `;