obdfcascrape/tests/rep.dk.js
Martin Donnelly be5d3eae07 init
2019-05-05 20:13:56 +01:00

41 lines
1007 B
JavaScript

const tape = require('tape');
const _test = require('tape-promise').default; // <---- notice 'default'
const test = _test(tape); // decorate tape
const Scraper = require('../helpers/scraper');
const url = 'http://vut.finanstilsynet.dk/';
test('DENMARK::WHOIS Test', async function(t) {
const s = new Scraper();
t.plan(3);
await s._getWhoIsRaw(url).then((r) => {
const testReg = /finanstilsynet.dk/;
t.equal(testReg.test(r), true, 'Get Raw DK WhoIS');
});
await s._getWhoIsJSON(url).then((r) => {
t.equal(r.domain, 'finanstilsynet.dk', 'Get JSON WHOIS');
});
await s._getWhoIsIPJSON(url).then((r) => {
t.equal(r.origin, 'AS42876', 'Get JSON WhoIS for IP Address');
});
t.end();
});
test.skip('DENMARK::SSL Test', async function(t) {
const s = new Scraper();
t.plan(1);
await s._getSSLCert(url).then((r) => {
// 02F16B45DE0D938C6585402ED2FA1E61
t.equal(r.serialNumber, '02F16B45DE0D938C6585402ED2FA1E61', 'Get SSL Certificate');
});
t.end();
});