1 | 'use strict'
|
2 |
|
3 |
|
4 |
|
5 | const fs = require('fs')
|
6 | const pickup = require('../')
|
7 | const parse = require('./lib/parse')
|
8 | const test = require('tap').test
|
9 | const path = require('path')
|
10 |
|
11 | test('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 | })
|