diff options
author | Chocobozzz <me@florianbigard.com> | 2021-12-24 13:53:19 +0100 |
---|---|---|
committer | Chocobozzz <me@florianbigard.com> | 2021-12-24 13:55:47 +0100 |
commit | 2d28b0c21dc066105677374419acd7ba8e919e8d (patch) | |
tree | 8cadfd42ee1a5dcbe871ec240b4947ebc9d8489c /server/tests/feeds | |
parent | 4ff75a3b2c48b2b0a1250cb551d2b73eb26d5296 (diff) | |
download | PeerTube-2d28b0c21dc066105677374419acd7ba8e919e8d.tar.gz PeerTube-2d28b0c21dc066105677374419acd7ba8e919e8d.tar.zst PeerTube-2d28b0c21dc066105677374419acd7ba8e919e8d.zip |
Upgrade fast xml parser dep
Diffstat (limited to 'server/tests/feeds')
-rw-r--r-- | server/tests/feeds/feeds.ts | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/server/tests/feeds/feeds.ts b/server/tests/feeds/feeds.ts index bf030162e..24a518342 100644 --- a/server/tests/feeds/feeds.ts +++ b/server/tests/feeds/feeds.ts | |||
@@ -2,7 +2,7 @@ | |||
2 | 2 | ||
3 | import 'mocha' | 3 | import 'mocha' |
4 | import * as chai from 'chai' | 4 | import * as chai from 'chai' |
5 | import { parse, validate } from 'fast-xml-parser' | 5 | import { XMLParser, XMLValidator } from 'fast-xml-parser' |
6 | import { | 6 | import { |
7 | cleanupTests, | 7 | cleanupTests, |
8 | createMultipleServers, | 8 | createMultipleServers, |
@@ -149,9 +149,10 @@ describe('Test syndication feeds', () => { | |||
149 | it('Should contain a valid enclosure (covers RSS 2.0 endpoint)', async function () { | 149 | it('Should contain a valid enclosure (covers RSS 2.0 endpoint)', async function () { |
150 | for (const server of servers) { | 150 | for (const server of servers) { |
151 | const rss = await server.feed.getXML({ feed: 'videos' }) | 151 | const rss = await server.feed.getXML({ feed: 'videos' }) |
152 | expect(validate(rss)).to.be.true | 152 | expect(XMLValidator.validate(rss)).to.be.true |
153 | 153 | ||
154 | const xmlDoc = parse(rss, { parseAttributeValue: true, ignoreAttributes: false }) | 154 | const parser = new XMLParser({ parseAttributeValue: true, ignoreAttributes: false }) |
155 | const xmlDoc = parser.parse(rss) | ||
155 | 156 | ||
156 | const enclosure = xmlDoc.rss.channel.item[0].enclosure | 157 | const enclosure = xmlDoc.rss.channel.item[0].enclosure |
157 | expect(enclosure).to.exist | 158 | expect(enclosure).to.exist |