Skip to content

Commit 4a27d08

Browse files
committed
Add pikabu test
1 parent 9d238de commit 4a27d08

File tree

3 files changed

+3911
-9
lines changed

3 files changed

+3911
-9
lines changed

__snapshots__/index.js.snap-shot

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -479,15 +479,15 @@ exports['motherboard 1'] = {
479479
}
480480

481481
exports['nytimes 1'] = {
482-
"author": "Tim Herrera",
483-
"date": "2017-07-03T09:00:04.000Z",
484-
"description": "Welcome to the second edition of the Smarter Living newsletter.",
485-
"favicon": "https://static01.nyt.com/images/icons/ios-ipad-144x144.png",
486-
"image": "https://static01.nyt.com/images/2017/06/23/smarter-living/Sl-newsletter-header/Sl-newsletter-header-facebookJumbo-v2.jpg",
487-
"logo": null,
488-
"publisher": "NYTimes",
489-
"title": "How to See What the Internet Knows About You (And How to Stop It)",
490-
"url": "https://www.nytimes.com/2017/07/03/smarter-living/how-to-see-what-the-internet-knows-about-you.html"
482+
"author": null,
483+
"date": null,
484+
"description": null,
485+
"favicon": "https://cs.pikabu.ru/images/icon_ios144.png",
486+
"image": "https://ads.adfox.ru/211055/getCode?p1=bvoqq&p2=v&pe=b&pfb=eyxrx&pfc=bpndz&pr=[RANDOM]",
487+
"logo": "https://counter.yadro.ru/logo;Pikabu?17.2",
488+
"publisher": "Комментарий дня ТОП 50 Вот так камеры в Москве фиксируют штрафы. +1314 figurist; 14 часов назад # Годный интерфейс, как в каком-нибудь фильме про хацкеров (:",
489+
"title": "Горячее",
490+
"url": "https://pikabu.ru"
491491
}
492492

493493
exports['pr-newswire 1'] = {

test/web/pikabu/index.js

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
'use strict'
2+
3+
const snapshot = require('snap-shot')
4+
const {promisify} = require('util')
5+
const {resolve} = require('path')
6+
7+
const fs = require('fs')
8+
9+
const getMetaData = require('../../..')
10+
const readFile = promisify(fs.readFile)
11+
12+
const url = 'https://pikabu.ru'
13+
14+
it('nytimes', async () => {
15+
const html = await readFile(resolve(__dirname, 'input.html'))
16+
const metadata = await getMetaData({html, url})
17+
console.log(metadata)
18+
snapshot(metadata)
19+
})

0 commit comments

Comments
 (0)