diff options
author | 2022-07-19 02:01:04 +0400 | |
---|---|---|
committer | 2022-07-18 15:01:04 -0700 | |
commit | 57e529e4c13f3e7829311ac6f92682eb6333fd96 (patch) | |
tree | 51e8a8abc12a349de8b91d6593a35b28e810f0e1 /packages/astro-rss/test/rss.test.js | |
parent | 72e777aad88a6c7946bf07abba849ed93d70bcb8 (diff) | |
download | astro-57e529e4c13f3e7829311ac6f92682eb6333fd96.tar.gz astro-57e529e4c13f3e7829311ac6f92682eb6333fd96.tar.zst astro-57e529e4c13f3e7829311ac6f92682eb6333fd96.zip |
Throw the error when `site` option is missing (#3956)
* Throw the error when site option is missing
* Update index.ts
* Update index.ts
* Update rss.test.js
* Update index.ts
Co-authored-by: Fred K. Schott <fkschott@gmail.com>
Diffstat (limited to '')
-rw-r--r-- | packages/astro-rss/test/rss.test.js | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/packages/astro-rss/test/rss.test.js b/packages/astro-rss/test/rss.test.js index 84cf7e36c..f4dc0ba6e 100644 --- a/packages/astro-rss/test/rss.test.js +++ b/packages/astro-rss/test/rss.test.js @@ -125,6 +125,20 @@ describe('rss', () => { }); describe('errors', () => { + it('should provide a error message when a "site" option is missing', async () => { + try { + await rss({ + title, + description, + items: [phpFeedItem, web1FeedItem] + }); + + chai.expect(false).to.equal(true, 'Should have errored'); + } catch (err) { + chai.expect(err.message).to.contain('[RSS] the "site" option is required, but no value was given.'); + } + }); + it('should provide a good error message when a link is not provided', async () => { try { await rss({ |