UNPKG

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