obdfcascrape/tests/rep.de.js

40 lines
985 B
JavaScript
Raw Permalink Normal View History

2019-05-05 19:13:56 +00:00
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 = 'https://portal.mvp.bafin.de/database/ZahlInstInfo/';
test('GERMANY::WHOIS Test', async function(t) {
const s = new Scraper();
t.plan(3);
await s._getWhoIsRaw(url).then((r) => {
const testReg = /bafin.de/;
t.equal(testReg.test(r), true, 'Get Raw DE WhoIS');
});
await s._getWhoIsJSON(url).then((r) => {
t.equal(r.domain, 'bafin.de', 'Test JSON for Germany');
});
await s._getWhoIsIPJSON(url).then((r) => {
t.equal(r.origin, 'AS8220', 'Get JSON WhoIS for IP Address');
});
t.end();
});
test.skip('CYPRUS::SSL Test', async function(t) {
const s = new Scraper();
t.plan(1);
await s._getSSLCert(url, true).then((r) => {
t.equal(r.serialNumber, '112109BE0239F24B1614150A8E8DDCA8AEC1', 'Get SSL Certificate');
});
t.end();
});