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

40 lines
1.7 KiB
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 = 'https://www.bancaditalia.it/';
test('ITALY::WHOIS Test', async function(t) {
const s = new Scraper();
await s._getWhoIsRaw(url, false).then((r) => {
const testReg = /Banca d'Italia/;
t.equal(testReg.test(r), true, 'Get Raw IT WhoIS');
});
await s._getWhoIsJSON(url).then((r) => {
t.deepLooseEqual(r, { 'additionalInformationCanBeVisualizedAt': '*', 'privacyInformation': 'http://web-whois.nic.it/privacy *', 'domain': 'bancaditalia.it', 'status': 'ok', 'signed': 'no', 'created': '1998-02-18 00:00:00 2013-12-20 15:50:44 2013-12-20 15:10:38 2011-04-08 17:58:12', 'lastUpdate': '2018-01-04 00:50:39 2013-12-20 15:50:44 2013-12-20 15:10:38 2014-11-18 16:47:38', 'expireDate': '2018-12-19', 'organization': 'Banca d\'Italia Banca d\'Italia Telecom Italia S.p.A Telecom Italia s.p.a.', 'address': 'Via Nazionale, 91 Via Nazionale, 91 Via Campania 11', 'name': 'Angela Barbaro Domains Tech Contact INTERBUSINESS-REG', 'web': 'http://www.impresasemplice.it', 'dnssec': 'no' }, 'Get JSON WhoIS');
});
// Turned this test off as the site appears to be hosted by Akami, IP changes almost every time.
await s._getWhoIsIPJSON(url).then((r) => {
t.equal(r.origin, 'AS34759', 'Get JSON WhoIS for IP Address');
});
t.end();
});
test.skip('ITALY::SSL Test', async function(t) {
const s = new Scraper();
t.plan(1);
await s._getSSLCert(url, true).then((r) => {
t.equal(r.serialNumber, '5C8B8180EFED1836', 'Get SSL Certificate');
});
t.end();
});