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

40 lines
1.4 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.fi.se/en/our-registers/company-register';
test('SWEDEN::WHOIS Test', async function(t) {
const s = new Scraper();
await s._getWhoIsRaw(url).then((r) => {
const testReg = /andfin9563-00001/;
t.equal(testReg.test(r), true, 'Get Raw NL WhoIS');
});
await s._getWhoIsJSON(url).then((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, 'AS1257', 'Get JSON WhoIS for IP Address');
});
t.end();
});
test.skip('SWEDEN::SSL Test', async function(t) {
const s = new Scraper();
t.plan(1);
await s._getSSLCert(url, true).then((r) => {
t.equal(r.serialNumber, '0B4F482E251EE5881F6B536AF87CE21B', 'Get SSL Certificate');
});
t.end();
});