mirror of
https://github.com/SukkaW/Surge.git
synced 2026-09-13 19:14:36 +08:00
Wire up Dead Domain CI Check for Node.js 26 [skip ci]
This commit is contained in:
20
Build/lib/is-domain-alive.test.ts
Normal file
20
Build/lib/is-domain-alive.test.ts
Normal 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.'
|
||||
);
|
||||
});
|
||||
});
|
||||
Reference in New Issue
Block a user