1 | 'use strict'
|
2 |
|
3 |
|
4 |
|
5 | const parse = require('./lib/parse')
|
6 | const pickup = require('../')
|
7 | const { test } = require('tap')
|
8 |
|
9 | test('nested item', (t) => {
|
10 | const xml = `<channel><item><item></item></item></channel>`
|
11 |
|
12 | const wanted = [
|
13 | ['entry', pickup.entry()],
|
14 | ['feed', pickup.feed()],
|
15 | ['finish'],
|
16 | ['end']
|
17 | ]
|
18 |
|
19 | parse({ t: t, xml: xml, wanted: wanted }, (er) => {
|
20 | t.ok(!er)
|
21 | t.end()
|
22 | })
|
23 | })
|
24 |
|
25 | test('nested feed', (t) => {
|
26 | const xml = `<channel><channel></channel><item></item></channel>`
|
27 |
|
28 | const wanted = [
|
29 | ['feed', pickup.feed()],
|
30 | ['entry', pickup.entry()],
|
31 | ['finish'],
|
32 | ['end']
|
33 | ]
|
34 |
|
35 | parse({ t: t, xml: xml, wanted: wanted }, (er) => {
|
36 | t.ok(!er)
|
37 | t.end()
|
38 | })
|
39 | })
|