2025-07-29 00:27:48 +00:00
|
|
|
import { expect, tap } from '@git.zone/tstest/tapbundle';
|
2023-04-03 16:48:14 +02:00
|
|
|
import * as smartwhois from '../ts/index.js';
|
|
|
|
|
|
|
|
|
|
let testSmartWhois: smartwhois.SmartWhois;
|
|
|
|
|
|
|
|
|
|
tap.test('should create a valid instance of SmartWhois', async () => {
|
|
|
|
|
testSmartWhois = new smartwhois.SmartWhois();
|
|
|
|
|
expect(testSmartWhois).toBeInstanceOf(smartwhois.SmartWhois);
|
2023-04-18 20:40:39 +02:00
|
|
|
});
|
|
|
|
|
|
|
|
|
|
tap.test('should get a parsed url result for whois', async () => {
|
2023-10-06 11:10:13 +02:00
|
|
|
const domainDelegation = await testSmartWhois.getDomainDelegation('https://coffee.link/understanding-gen-z/');
|
|
|
|
|
console.log(domainDelegation);
|
2023-04-19 21:36:44 +02:00
|
|
|
const parsedUrlResult2 = await testSmartWhois.getDomainDelegation('task.vc');
|
2023-04-19 18:57:12 +02:00
|
|
|
console.log(parsedUrlResult2);
|
2023-04-18 20:40:39 +02:00
|
|
|
});
|
2023-04-03 16:48:14 +02:00
|
|
|
|
2023-04-19 14:52:37 +02:00
|
|
|
tap.test('should get additional data', async () => {
|
|
|
|
|
const parsedUrlResult = await testSmartWhois.getAdditionalWhoisDataForDomain('https://coffee.link/understanding-gen-z/');
|
|
|
|
|
console.log(parsedUrlResult);
|
|
|
|
|
});
|
|
|
|
|
|
2023-04-03 16:48:14 +02:00
|
|
|
tap.test('should get whois info for domain', async () => {
|
|
|
|
|
const whoisInfo = await testSmartWhois.getWhoisForDomain('task.vc');
|
|
|
|
|
console.log(whoisInfo);
|
|
|
|
|
});
|
2023-04-19 18:49:06 +02:00
|
|
|
tap.test('should get whois info for domain', async () => {
|
|
|
|
|
const whoisInfo = await testSmartWhois.getWhoisForDomain('https://lossless.com');
|
|
|
|
|
console.log(whoisInfo);
|
|
|
|
|
});
|
2023-04-03 16:48:14 +02:00
|
|
|
|
2023-04-18 20:40:39 +02:00
|
|
|
tap.test('should get whois info for domain', async () => {
|
|
|
|
|
const whoisInfo = await testSmartWhois.getWhoisForDomain('https://coffee.link/understanding-gen-z/');
|
|
|
|
|
console.log(whoisInfo);
|
|
|
|
|
});
|
|
|
|
|
|
2023-04-03 17:50:55 +02:00
|
|
|
tap.test('should check for a valid tld', async () => {
|
|
|
|
|
const comIsValid = await testSmartWhois.isValidTld('.com');
|
|
|
|
|
console.log(comIsValid);
|
|
|
|
|
expect(comIsValid).toBeTrue();
|
|
|
|
|
})
|
|
|
|
|
|
2023-04-03 16:48:14 +02:00
|
|
|
tap.start();
|