UNPKG

571 BJavaScriptView Raw
1'use strict'
2
3// parse <enclosure />
4
5const fs = require('fs')
6const parse = require('./lib/parse')
7const path = require('path')
8const pickup = require('../')
9const { test } = require('tap')
10
11test('enclosure', (t) => {
12 const p = path.join(__dirname, 'data', 'enclosure.xml')
13 const xml = fs.readFileSync(p)
14
15 const wanted = [
16 ['entry', pickup.entry({
17 enclosure: { url: 'abc', type: undefined, length: undefined }
18 })],
19 ['feed'],
20 ['finish'],
21 ['end']
22 ]
23
24 parse({ t: t, xml: xml, wanted: wanted }, (er) => {
25 t.ok(!er)
26 t.end()
27 })
28})