smartwhois/test/test.ts

23 lines
698 B
TypeScript
Raw Normal View History

2023-04-03 14:48:14 +00:00
import { expect, expectAsync, tap } from '@pushrocks/tapbundle';
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);
})
tap.test('should get whois info for domain', async () => {
const whoisInfo = await testSmartWhois.getWhoisForDomain('task.vc');
console.log(whoisInfo);
});
2023-04-03 15:50:55 +00: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 14:48:14 +00:00
tap.start();