summaryrefslogtreecommitdiff
path: root/packages/astro-rss/test/rss.test.js
diff options
context:
space:
mode:
authorGravatar Matthew Phillips <matthew@skypack.dev> 2022-07-13 16:37:17 -0400
committerGravatar GitHub <noreply@github.com> 2022-07-13 16:37:17 -0400
commitcd2dbfedb15969274df40b1c41b6680ea8885e8d (patch)
tree8927b01efe1d80bd6170ff5834049609cf0cb9dd /packages/astro-rss/test/rss.test.js
parent75f202a12416bb9e605110e112c34332c09738aa (diff)
downloadastro-cd2dbfedb15969274df40b1c41b6680ea8885e8d.tar.gz
astro-cd2dbfedb15969274df40b1c41b6680ea8885e8d.tar.zst
astro-cd2dbfedb15969274df40b1c41b6680ea8885e8d.zip
Provide a better error message for when RSS is missing `link` field (#3913)
* Provide a better error message for when RSS is missing `link` field * Adds a changeset
Diffstat (limited to 'packages/astro-rss/test/rss.test.js')
-rw-r--r--packages/astro-rss/test/rss.test.js20
1 files changed, 20 insertions, 0 deletions
diff --git a/packages/astro-rss/test/rss.test.js b/packages/astro-rss/test/rss.test.js
index 9962e83f9..bc5816142 100644
--- a/packages/astro-rss/test/rss.test.js
+++ b/packages/astro-rss/test/rss.test.js
@@ -123,4 +123,24 @@ describe('rss', () => {
).to.be.rejected;
});
});
+
+ describe('errors', () => {
+ it('should provide a good error message when a link is not provided', async () => {
+ try {
+ await rss({
+ title: 'Your Website Title',
+ description: 'Your Website Description',
+ site: 'https://astro-demo',
+ items: [{
+ pubDate: new Date(),
+ title: 'Some title',
+ slug: 'foo'
+ }]
+ });
+ chai.expect(false).to.equal(true, 'Should have errored');
+ } catch(err) {
+ chai.expect(err.message).to.contain('Required field [link] is missing');
+ }
+ });
+ })
});