1 |
|
2 |
|
3 | // parse feed image
|
4 |
|
5 | const parse = require('./lib/parse')
|
6 | const { test } = require('tap')
|
7 |
|
8 | test('image', (t) => {
|
9 | const xml = [
|
10 | '<rss><channel>',
|
11 | '<itunes:image href="abc" />',
|
12 | '<media:thumbnail url="def" />',
|
13 | '<image><url>ghi</url></image>',
|
14 | '</channel></rss>'
|
15 | ].join()
|
16 |
|
17 | const wanted = [
|
18 | ['feed', {
|
19 | image: 'abc'
|
20 | }],
|
21 | ['finish'],
|
22 | ['end']
|
23 | ]
|
24 |
|
25 | parse({ t: t, xml: xml, wanted: wanted }, (er) => {
|
26 | t.ok(!er)
|
27 | t.end()
|
28 | })
|
29 | })
|