summaryrefslogtreecommitdiff
path: root/packages/astro-rss/test/rss.test.js
diff options
context:
space:
mode:
Diffstat (limited to 'packages/astro-rss/test/rss.test.js')
-rw-r--r--packages/astro-rss/test/rss.test.js41
1 files changed, 23 insertions, 18 deletions
diff --git a/packages/astro-rss/test/rss.test.js b/packages/astro-rss/test/rss.test.js
index dea3e7787..3ef617486 100644
--- a/packages/astro-rss/test/rss.test.js
+++ b/packages/astro-rss/test/rss.test.js
@@ -240,25 +240,30 @@ describe('getRssString', () => {
});
it('should not fail when an enclosure has a length of 0', async () => {
- const str = await getRssString({
- title,
- description,
- items: [
- {
- title: 'Title',
- pubDate: new Date().toISOString(),
- description: 'Description',
- link: '/link',
- enclosure: {
- url: '/enclosure',
- length: 0,
- type: 'audio/mpeg',
+ let error = null;
+ try {
+ await getRssString({
+ title,
+ description,
+ items: [
+ {
+ title: 'Title',
+ pubDate: new Date().toISOString(),
+ description: 'Description',
+ link: '/link',
+ enclosure: {
+ url: '/enclosure',
+ length: 0,
+ type: 'audio/mpeg',
+ },
},
- },
- ],
- site,
- });
+ ],
+ site,
+ });
+ } catch (e) {
+ error = e.message;
+ }
- chai.expect(str).to.not.throw;
+ assert.strictEqual(error, null);
});
});