42 lines
1.5 KiB
JavaScript
42 lines
1.5 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.mfsa.com.mt/pages/licenceholders.aspx';
|
|
|
|
test('MALTA::WHOIS Test', async function(t) {
|
|
const s = new Scraper();
|
|
|
|
await s._getWhoIsRaw(url).then((r) => {
|
|
console.log(r);
|
|
const testReg = /Malta Financial Services Authority/;
|
|
|
|
t.equal(testReg.test(r), true, 'Get Raw NL WhoIS');
|
|
});
|
|
|
|
await s._getWhoIsJSON(url).then((r) => {
|
|
console.log(r);
|
|
t.deepLooseEqual(r, { 'state': 'active', 'domain': 'fi.se', 'holder': 'andfin9563-00001', 'adminC': '-', 'techC': '-', 'billingC': '-', 'created': '1994-07-05', 'modified': '2017-12-01', 'expires': '2018-12-31', 'transferred': '2012-03-14', 'nserver': 'kalmar.dns.swip.net ns.fi.se 193.15.242.204 ns1.fi.se 193.15.242.193', 'dnssec': 'unsigned delegation', 'status': 'ok', 'registrar': 'Loopia AB' }, '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, 'AS15735 AS5532', 'Get JSON WhoIS for IP Address');
|
|
});
|
|
|
|
t.end();
|
|
});
|
|
|
|
test.skip('MALTA::SSL Test', async function(t) {
|
|
const s = new Scraper();
|
|
t.plan(1);
|
|
|
|
await s._getSSLCert(url, true).then((r) => {
|
|
t.equal(r.serialNumber, '3868B68C5193EEE779994A398109FDC1', 'Get SSL Certificate');
|
|
});
|
|
|
|
t.end();
|
|
});
|