Skip to content

Commit 46024e5

Browse files
test: 优化dns测试用例 2
1 parent d52b656 commit 46024e5

File tree

2 files changed

+9
-1
lines changed

2 files changed

+9
-1
lines changed

packages/core/src/utils/util.version.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ function parseVersion (version) {
1414
* @param log 日志对象
1515
* @returns {number} 比较线上版本号是否为更新的版本,大于0=是|0=相等|小于0=否|-999=出现异常,比较结果未知
1616
*/
17-
export function isNewVersion (onlineVersion, currentVersion, log = console) {
17+
export function isNewVersion (onlineVersion, currentVersion, log = null) {
1818
if (onlineVersion === currentVersion) {
1919
return 0
2020
}

packages/mitmproxy/test/dnsTest.mjs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -111,6 +111,14 @@ console.log('\n--------------- test ForSNI ---------------\n')
111111
console.log(`===> test ForSNI: ${dnsProviders.ForSNI.dnsName}`, '\n\n')
112112
assert.strictEqual(dnsProviders.ForSNI, dnsProviders.safe360)
113113

114+
const dnsProviders2 = dns.initDNS({
115+
aliyun: {
116+
server: 'udp://223.5.5.5',
117+
},
118+
}, {})
119+
console.log(`===> test ForSNI2: ${dnsProviders2.ForSNI.dnsName}`, '\n\n')
120+
assert.strictEqual(dnsProviders2.ForSNI, dnsProviders2.PreSet) // 未配置forSNI的DNS时,默认使用PreSet作为ForSNI
121+
114122

115123
console.log('\n--------------- test PreSet ---------------\n')
116124
ip = await dnsProviders.PreSet.lookup(hasPresetHostname)

0 commit comments

Comments
 (0)