Skip to content

Commit

Permalink
fix(rss): use node assert instead of chai (withastro#9980)
Browse files Browse the repository at this point in the history
  • Loading branch information
florian-lefebvre authored Feb 5, 2024
1 parent 19df112 commit b3b9f28
Showing 1 changed file with 23 additions and 18 deletions.
41 changes: 23 additions & 18 deletions packages/astro-rss/test/rss.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
});
});

0 comments on commit b3b9f28

Please sign in to comment.