Wire up Dead Domain CI Check for Node.js 26 [skip ci]

This commit is contained in:
SukkaW
2026-08-09 18:32:00 +08:00
parent 14f5811242
commit f141253cfe
5 changed files with 41 additions and 13 deletions

View File

@@ -0,0 +1,20 @@
import { describe, it } from 'mocha';
import { expect } from 'earl';
import { DOMAIN_ALIVE_REASON_MESSAGES, DOMAIN_ALIVE_REASONS } from 'domain-alive';
import { createDomainAliveMethods } from './is-domain-alive';
describe('domain-alive integration', () => {
it('constructs the checkers with the custom DoH agent', async () => {
const { isDomainAlive, isRegisterableDomainAlive } = createDomainAliveMethods({});
const [domainResult, registerableDomainResult] = await Promise.all([
isDomainAlive(''),
isRegisterableDomainAlive('')
]);
expect(domainResult.reason).toEqual(DOMAIN_ALIVE_REASONS.INVALID_DOMAIN);
expect(registerableDomainResult.reason).toEqual(DOMAIN_ALIVE_REASONS.INVALID_DOMAIN);
expect(DOMAIN_ALIVE_REASON_MESSAGES[domainResult.reason]).toEqual(
'No registerable domain could be extracted.'
);
});
});