jobscraper/test/s1jobs.js
2020-05-22 23:40:33 +01:00

38 lines
745 B
JavaScript

/**
* Created by WebStorm.
* User: martin
* Date: 22/05/2020
* Time: 21:01
*/
/**
* Created by WebStorm.
* User: martin
* Date: 22/05/2020
* Time: 12:18
*/
const tape = require('tape');
const _test = require('tape-promise').default; // <---- notice 'default'
const test = _test(tape); // decorate tape
const fs = require('fs');
const cheerio = require('cheerio');
const RssS1Jobs = require('../scrapers/rss.s1jobs');
const s1jobsScraper = new RssS1Jobs();
const feed = fs.readFileSync('test/data/s1jobs/m7dp711z2r.xml');
test.test('Test Jobserve scraper', async t => {
await s1jobsScraper.loadFeed(feed);
s1jobsScraper.reduceItems();
await s1jobsScraper.filterAdverts();
await s1jobsScraper.addToDB();
t.end();
});