upgrade dependencies | fixing tests

This commit is contained in:
Christian Kellner
2019-03-16 13:01:35 +01:00
parent 3eef92c184
commit 0f71c8a32e
5 changed files with 1175 additions and 351 deletions

View File

@@ -4,7 +4,7 @@ const utils = require('../utils');
function normalize(o) {
const id = parseInt(o.id.substring(o.id.indexOf('_') + 1, o.id.length));
const size = o.size.replace('Wohnfläche ', '');
const size = o.size != null ? o.size.replace('Wohnfläche ', '') : 'N/A m²';
const price = o.price.replace('Kaufpreis ', '');
const address = o.address.split(' • ')[1];

View File

@@ -3,8 +3,7 @@ const Fredy = require('../fredy');
const utils = require('../utils');
function normalize(o) {
const title = o.title + '| '+o.subTitle;
return Object.assign(o, { title });
return o;
}
function applyBlacklist(o) {
@@ -20,8 +19,7 @@ const neubauKompass = {
id: '@id',
title: 'a@title | removeNewline | trim',
link: 'a@href',
subTitle: '.p-3 .mb-2 | removeNewline | trim',
address: 'div.p-3 > p:nth-child(3) | removeNewline | trim'
address: 'div.p-2 > p:nth-child(3) | removeNewline | trim'
},
paginate: '.numbered-pager__bottom .numbered-pager--info li:nth-child(2) a@href',
normalize: normalize,