diff options
author | 2023-03-09 07:57:03 +0000 | |
---|---|---|
committer | 2023-03-09 07:57:03 +0000 | |
commit | 2e362042c222298fd6cd80a64c1d7b7f3f608a79 (patch) | |
tree | 0b335fe67285ca21d59b4df0610b9aafd52d9b9e /packages/astro-rss/test/rss.test.js | |
parent | 77a046e886c370b737208574b6934f5a1cf2b177 (diff) | |
download | astro-2e362042c222298fd6cd80a64c1d7b7f3f608a79.tar.gz astro-2e362042c222298fd6cd80a64c1d7b7f3f608a79.tar.zst astro-2e362042c222298fd6cd80a64c1d7b7f3f608a79.zip |
feat(rss): add option to remove the trailing slash (#6453)
* feat(rss): add option to remove the trailing slash
* Apply suggestions from code review
Co-authored-by: Sarah Rainsberger <sarah@rainsberger.ca>
* suggestions
---------
Co-authored-by: Sarah Rainsberger <sarah@rainsberger.ca>
Diffstat (limited to 'packages/astro-rss/test/rss.test.js')
-rw-r--r-- | packages/astro-rss/test/rss.test.js | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/packages/astro-rss/test/rss.test.js b/packages/astro-rss/test/rss.test.js index 744471f8c..d519d19ca 100644 --- a/packages/astro-rss/test/rss.test.js +++ b/packages/astro-rss/test/rss.test.js @@ -107,7 +107,6 @@ describe('rss', () => { const { body } = await rss({ title, description, - drafts: true, items: [phpFeedItem, { ...web1FeedItem, draft: true }], site, drafts: true, @@ -116,6 +115,20 @@ describe('rss', () => { chai.expect(body).xml.to.equal(validXmlResult); }); + it('should not append trailing slash to URLs with the given option', async () => { + const { body } = await rss({ + title, + description, + items: [phpFeedItem, { ...web1FeedItem, draft: true }], + site, + drafts: true, + trailingSlash: false, + }); + + chai.expect(body).xml.to.contain('https://example.com/<'); + chai.expect(body).xml.to.contain('https://example.com/php<'); + }); + it('Deprecated import.meta.glob mapping still works', async () => { const globResult = { './posts/php.md': () => |