From 2d28b0c21dc066105677374419acd7ba8e919e8d Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Fri, 24 Dec 2021 13:53:19 +0100 Subject: Upgrade fast xml parser dep --- server/tests/feeds/feeds.ts | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'server/tests/feeds/feeds.ts') 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 @@ import 'mocha' import * as chai from 'chai' -import { parse, validate } from 'fast-xml-parser' +import { XMLParser, XMLValidator } from 'fast-xml-parser' import { cleanupTests, createMultipleServers, @@ -149,9 +149,10 @@ describe('Test syndication feeds', () => { it('Should contain a valid enclosure (covers RSS 2.0 endpoint)', async function () { for (const server of servers) { const rss = await server.feed.getXML({ feed: 'videos' }) - expect(validate(rss)).to.be.true + expect(XMLValidator.validate(rss)).to.be.true - const xmlDoc = parse(rss, { parseAttributeValue: true, ignoreAttributes: false }) + const parser = new XMLParser({ parseAttributeValue: true, ignoreAttributes: false }) + const xmlDoc = parser.parse(rss) const enclosure = xmlDoc.rss.channel.item[0].enclosure expect(enclosure).to.exist -- cgit v1.2.3