fix(test): stabilize DNS availability tests with deterministic records and shorter retries

This commit is contained in:
2026-04-30 12:59:05 +00:00
parent dcfed89115
commit e1d46c6b43
4 changed files with 12 additions and 9 deletions
+6
View File
@@ -1,5 +1,11 @@
# Changelog
## 2026-04-30 - 7.9.2 - fix(test)
stabilize DNS availability tests with deterministic records and shorter retries
- replace the external TXT record lookup with a localhost A record check to avoid network-dependent test behavior
- reduce retry count and delay in failing checkUntilAvailable assertions to keep test runs faster and more predictable
## 2026-04-30 - 7.9.1 - fix(client,testing,build)
improve TypeScript compatibility for DNS client parsing and test suite
+1 -1
View File
@@ -1,6 +1,6 @@
The MIT License (MIT)
Copyright (c) 2016 Push.Rocks
Copyright (c) 2016 Task Venture Capital GmbH
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
+4 -7
View File
@@ -45,22 +45,19 @@ tap.test('should get a mx record for a domain (system)', async () => {
});
tap.test('should check until DNS is available', async () => {
const records = await testDnsClient.getRecordsTxt('google.com');
if (records.length > 0) {
const result = await testDnsClient.checkUntilAvailable('google.com', 'TXT', records[0].value);
expect(result).toBeTrue();
}
const result = await testDnsClient.checkUntilAvailable('localhost', 'A', '127.0.0.1', 4, 50);
expect(result).toBeTrue();
});
tap.test('should check until DNS is available and return false if it fails', async () => {
return expect(
await testDnsClient.checkUntilAvailable('google.com', 'TXT', 'this-txt-record-does-not-exist')
await testDnsClient.checkUntilAvailable('google.com', 'TXT', 'this-txt-record-does-not-exist', 2, 50)
).toBeFalse();
});
tap.test('should check until DNS is available and return false if it fails', async () => {
return expect(
await testDnsClient.checkUntilAvailable('nonexistent.example.com', 'TXT', 'sometext_txt2')
await testDnsClient.checkUntilAvailable('nonexistent.example.com', 'TXT', 'sometext_txt2', 2, 50)
).toBeFalse();
});
+1 -1
View File
@@ -3,6 +3,6 @@
*/
export const commitinfo = {
name: '@push.rocks/smartdns',
version: '7.9.1',
version: '7.9.2',
description: 'A robust TypeScript library providing advanced DNS management and resolution capabilities including support for DNSSEC, custom DNS servers, and integration with various DNS providers.'
}