From fa8ec57f16a970e642e69eeeba425a1affd05189 Mon Sep 17 00:00:00 2001 From: matthewp Date: Wed, 13 Jul 2022 20:39:29 +0000 Subject: [PATCH] [ci] format --- packages/astro-rss/src/index.ts | 8 +++++--- packages/astro-rss/test/rss.test.js | 16 +++++++++------- 2 files changed, 14 insertions(+), 10 deletions(-) diff --git a/packages/astro-rss/src/index.ts b/packages/astro-rss/src/index.ts index 2ff803d8b..d715b7dc0 100644 --- a/packages/astro-rss/src/index.ts +++ b/packages/astro-rss/src/index.ts @@ -152,9 +152,11 @@ const requiredFields = Object.freeze(['link', 'title']); // Perform validation to make sure all required fields are passed. function validate(item: RSSFeedItem) { - for(const field of requiredFields) { - if(!(field in item)) { - throw new Error(`@astrojs/rss: Required field [${field}] is missing. RSS cannot be generated without it.`); + for (const field of requiredFields) { + if (!(field in item)) { + throw new Error( + `@astrojs/rss: Required field [${field}] is missing. RSS cannot be generated without it.` + ); } } } diff --git a/packages/astro-rss/test/rss.test.js b/packages/astro-rss/test/rss.test.js index bc5816142..84cf7e36c 100644 --- a/packages/astro-rss/test/rss.test.js +++ b/packages/astro-rss/test/rss.test.js @@ -131,16 +131,18 @@ describe('rss', () => { title: 'Your Website Title', description: 'Your Website Description', site: 'https://astro-demo', - items: [{ - pubDate: new Date(), - title: 'Some title', - slug: 'foo' - }] + items: [ + { + pubDate: new Date(), + title: 'Some title', + slug: 'foo', + }, + ], }); chai.expect(false).to.equal(true, 'Should have errored'); - } catch(err) { + } catch (err) { chai.expect(err.message).to.contain('Required field [link] is missing'); } }); - }) + }); });