Skip to content

Commit

Permalink
Add pikabu test
Browse files Browse the repository at this point in the history
  • Loading branch information
Kikobeats committed Oct 30, 2017
1 parent 9d238de commit 4a27d08
Show file tree
Hide file tree
Showing 3 changed files with 3,911 additions and 9 deletions.
18 changes: 9 additions & 9 deletions __snapshots__/index.js.snap-shot
Original file line number Diff line number Diff line change
Expand Up @@ -479,15 +479,15 @@ exports['motherboard 1'] = {
}

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

exports['pr-newswire 1'] = {
Expand Down
19 changes: 19 additions & 0 deletions test/web/pikabu/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
'use strict'

const snapshot = require('snap-shot')
const {promisify} = require('util')
const {resolve} = require('path')

const fs = require('fs')

const getMetaData = require('../../..')
const readFile = promisify(fs.readFile)

const url = 'https://pikabu.ru'

it('nytimes', async () => {
const html = await readFile(resolve(__dirname, 'input.html'))
const metadata = await getMetaData({html, url})
console.log(metadata)
snapshot(metadata)
})
Loading

0 comments on commit 4a27d08

Please sign in to comment.