Skip to content

Commit 9613adb

Browse files
committed
test: update snapshot
1 parent 56f3161 commit 9613adb

File tree

4 files changed

+42
-23
lines changed

4 files changed

+42
-23
lines changed

packages/metascraper-manifest/src/index.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,9 @@ module.exports = opts => {
5555
const rules = {
5656
lang: manifest({ from: 'lang' }),
5757
description: manifest({ from: 'description' }),
58-
publisher: manifest({ from: 'short_name', to: 'publisher' }),
58+
publisher:
59+
manifest({ from: 'short_name', to: 'publisher' }) ||
60+
manifest({ from: 'name', to: 'publisher' }),
5961
logo: async ({ htmlDom, url }) => {
6062
const manifest = await toManifest(htmlDom, url)
6163
if (!manifest) return

packages/metascraper-manifest/test/index.js

Lines changed: 18 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -88,32 +88,37 @@ test('vercel.com', async t => {
8888
t.snapshot(metadata)
8989
})
9090

91-
test('segment.com', async t => {
91+
test('linkedin.com', async t => {
9292
const metascraper = createMetascraper()
93-
const url = 'https://segment.com/blog/scaling-nsq/'
93+
const url = 'https://linkedin.com/Kikobeats/'
9494
const html = createHtml(['<link rel="manifest" href="/manifest.json">'])
9595
const metadata = await metascraper({ url, html })
9696
t.snapshot(metadata)
9797
})
9898

99-
test('youtube.com', async t => {
99+
test('medium.com', async t => {
100100
const metascraper = createMetascraper()
101-
const url = 'https://www.youtube.com/feed/explore'
102-
const html = createHtml([
103-
'<link rel="manifest" href="/manifest.webmanifest" crossorigin="use-credentials">'
104-
])
101+
const url =
102+
'https://medium.com/in-fitness-and-in-health/20-hard-won-fitness-lessons-from-my-20-year-fitness-journey-9971a8a8f0e1'
103+
const html = createHtml(['<link rel="manifest" href="/manifest.json">'])
105104
const metadata = await metascraper({ url, html })
106105
t.snapshot(metadata)
107106
})
108107

109-
test('twitter.com', async t => {
108+
test('github.com', async t => {
110109
const metascraper = createMetascraper()
111-
const url = 'https://twitter.com/explore'
110+
const url = 'https://github.com/Kikobeats/'
111+
const html = createHtml(['<link rel="manifest" href="/manifest.json">'])
112+
const metadata = await metascraper({ url, html })
113+
t.snapshot(metadata)
114+
})
115+
116+
test('youtube.com', async t => {
117+
const metascraper = createMetascraper()
118+
const url = 'https://www.youtube.com/feed/explore'
112119
const html = createHtml([
113-
'<link rel="manifest" href="/manifest.json" crossorigin="use-credentials">'
120+
'<link rel="manifest" href="/manifest.webmanifest" crossorigin="use-credentials">'
114121
])
115-
const { logo, ...metadata } = await metascraper({ url, html })
116-
117-
t.true(logo.startsWith('http'))
122+
const metadata = await metascraper({ url, html })
118123
t.snapshot(metadata)
119124
})

packages/metascraper-manifest/test/snapshots/index.js.md

Lines changed: 21 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -59,34 +59,46 @@ Generated by [AVA](https://avajs.dev).
5959
publisher: 'Vercel',
6060
}
6161

62-
## segment.com
62+
## linkedin.com
6363

6464
> Snapshot 1
6565
6666
{
6767
description: null,
6868
lang: null,
69-
logo: 'https://segment.com/images/favicons/android-icon-72x72.png',
70-
publisher: 'Segment',
69+
logo: null,
70+
publisher: null,
7171
}
7272

73-
## youtube.com
73+
## medium.com
7474

7575
> Snapshot 1
7676
7777
{
7878
description: null,
7979
lang: null,
80-
logo: 'https://www.gstatic.com/youtube/img/branding/favicon/favicon_192x192_v2.png',
81-
publisher: 'YouTube',
80+
logo: 'https://miro.medium.com/v2/568a88686a7038c2e6b521f43a3a3b9c7ef0d02e3d9707657a1c714324f9fac0',
81+
publisher: 'Medium',
8282
}
8383

84-
## twitter.com
84+
## github.com
8585

8686
> Snapshot 1
8787
8888
{
89-
description: 'Get breaking news, politics, trending music, world events, sports scores, and the latest global news stories as they unfold - all with less data.',
89+
description: null,
9090
lang: null,
91-
publisher: 'X',
91+
logo: 'https://github.githubassets.com/assets/app-icon-512-7f9c4ff2e960.png',
92+
publisher: 'GitHub',
93+
}
94+
95+
## youtube.com
96+
97+
> Snapshot 1
98+
99+
{
100+
description: null,
101+
lang: null,
102+
logo: 'https://www.gstatic.com/youtube/img/web/maskable/logo_512x512.png',
103+
publisher: 'YouTube',
92104
}
-23 Bytes
Binary file not shown.

0 commit comments

Comments
 (0)