fix(core): Improve nested DNS record management and worker script multipart handling

This commit is contained in:
2025-04-26 12:37:19 +00:00
parent e1c38ab7f8
commit 4b82cfbaae
6 changed files with 72 additions and 9 deletions

View File

@ -149,6 +149,52 @@ tap.test('should update A record content', async (tools) => {
console.log(`Updated A record for ${subdomain} to 192.168.1.1`);
});
// Nested subdomain DNS record tests
tap.test('should create A record for nested subdomain', async (tools) => {
tools.timeout(600000);
const nestedSubdomain = `${randomPrefix}-nested.sub.bleu.de`;
const result = await testCloudflareAccount.convenience.createRecord(
nestedSubdomain,
'A',
'127.0.0.5',
120
);
expect(result).toBeTypeOf('object');
console.log(`Created nested A record for ${nestedSubdomain}`);
});
tap.test('should get A record for nested subdomain', async (tools) => {
tools.timeout(600000);
const nestedSubdomain = `${randomPrefix}-nested.sub.bleu.de`;
const record = await testCloudflareAccount.convenience.getRecord(nestedSubdomain, 'A');
expect(record).toBeTypeOf('object');
expect(record.content).toEqual('127.0.0.5');
console.log(`Successfully retrieved nested A record for ${nestedSubdomain}`);
});
tap.test('should update A record for nested subdomain', async (tools) => {
tools.timeout(600000);
const nestedSubdomain = `${randomPrefix}-nested.sub.bleu.de`;
const result = await testCloudflareAccount.convenience.updateRecord(
nestedSubdomain,
'A',
'127.0.0.6',
120
);
expect(result).toBeTypeOf('object');
expect(result.content).toEqual('127.0.0.6');
console.log(`Updated nested A record for ${nestedSubdomain}`);
});
tap.test('should remove nested subdomain A record', async (tools) => {
tools.timeout(600000);
const nestedSubdomain = `${randomPrefix}-nested.sub.bleu.de`;
await testCloudflareAccount.convenience.removeRecord(nestedSubdomain, 'A');
const record = await testCloudflareAccount.convenience.getRecord(nestedSubdomain, 'A');
expect(record).toBeUndefined();
console.log(`Successfully removed nested A record for ${nestedSubdomain}`);
});
tap.test('should clean TXT records', async (tools) => {
tools.timeout(600000);
const subdomain = `${randomPrefix}-txt-test.bleu.de`;