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

41 lines
1.1 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.regafi.fr/spip.php?page=results&type=advanced&denomination=&siren=&cib=&bic=&nom=&siren_agent=&num=&cat=21-TBR07&retrait=0&lang=en&id_secteur=3';
test('FRANCE::WHOIS Test', async function(t) {
const s = new Scraper();
t.plan(3);
await s._getWhoIsJSON(url).then((r) => {
t.equal(r.domain, 'regafi.fr', 'Get FR TLD');
});
await s._getWhoIsRaw(url).then((r) => {
const testReg = /regafi.fr/;
t.equal(testReg.test(r), true, 'Get Raw FR WhoIS');
});
await s._getWhoIsIPJSON(url).then((r) => {
t.equal(r.origin, 'AS3215', 'Get JSON WhoIS for IP Address');
});
t.end();
});
test.skip('FRANCE::SSL Test', async function(t) {
const s = new Scraper();
t.plan(1);
await s._getSSLCert(url, true).then((r) => {
// 3349F097DA0E8CCACCD3A787
t.equal(r.serialNumber, '3349F097DA0E8CCACCD3A787', 'Get SSL Certificate');
});
t.end();
});