smartstring/test/test.domain.ts

33 lines
1.1 KiB
TypeScript
Raw Permalink Normal View History

import * as smartstring from '../ts/index';
import { tap, expect } from '@pushrocks/tapbundle';
2017-10-05 13:55:59 +00:00
// Domain
let testDomain: smartstring.Domain;
let testDomain2: smartstring.Domain;
2017-10-05 13:55:59 +00:00
tap.test('expect create a new Domain object', async () => {
testDomain = new smartstring.Domain('https://level3D.level2D.level1D');
expect(testDomain).be.instanceof(smartstring.Domain);
console.log(testDomain);
});
2017-10-05 13:55:59 +00:00
tap.test('expect have a .topLevel', async () => {
expect(testDomain.topLevel).equal('level1D');
});
2017-10-05 13:55:59 +00:00
tap.test('expect have a .level2', async () => {
expect(testDomain.level2).equal('level2D');
});
2017-10-05 13:55:59 +00:00
tap.test('expect have a .level3', async () => {
expect(testDomain.level3).equal('level3D');
});
2017-10-05 13:55:59 +00:00
tap.test('expect have the correct dns zone name', async () => {
expect(testDomain.zoneName).equal('level2D.level1D');
});
2017-10-05 13:55:59 +00:00
tap.test('expect have the correct protocol', async () => {
expect(testDomain.protocol).equal('https');
});
2017-10-05 13:55:59 +00:00
tap.test('testDomain2 expect be a basic domain', async () => {
testDomain2 = new smartstring.Domain('bleu.de');
console.log(testDomain2);
});
2017-10-05 13:55:59 +00:00
tap.start();