41 lines
1.0 KiB
JavaScript
41 lines
1.0 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 = 'http://registers.centralbank.ie/Home.aspx';
|
|
|
|
test('IRELAND::WHOIS Test', async function(t) {
|
|
const s = new Scraper();
|
|
t.plan(3);
|
|
|
|
await s._getWhoIsRaw(url).then((r) => {
|
|
const testReg = /centralbank.ie/;
|
|
|
|
t.equal(testReg.test(r), true, 'Get Raw CY WhoIS');
|
|
});
|
|
|
|
await s._getWhoIsJSON(url).then((r) => {
|
|
t.deepLooseEqual(r.domain, 'centralbank.ie', 'Get WHOIS Json');
|
|
});
|
|
|
|
await s._getWhoIsIPJSON(url).then((r) => {
|
|
t.equal(r.originAs, 'AS55002', 'Get JSON WhoIS for IP Address');
|
|
});
|
|
|
|
t.end();
|
|
});
|
|
|
|
test.skip('IRELAND::SSL Test', async function(t) {
|
|
const s = new Scraper();
|
|
t.plan(1);
|
|
|
|
await s._getSSLCert(url).then((r) => {
|
|
// A2EBC3C2585A014CE92D40BC99AE359A
|
|
t.equal(r.serialNumber, 'A2EBC3C2585A014CE92D40BC99AE359A', 'Get SSL Certificate');
|
|
});
|
|
|
|
t.end();
|
|
});
|