Skip to content

Commit

Permalink
[ci] format
Browse files Browse the repository at this point in the history
  • Loading branch information
bholmesdev authored and github-actions[bot] committed May 3, 2022
1 parent fbfb619 commit 204ff2c
Showing 1 changed file with 48 additions and 34 deletions.
82 changes: 48 additions & 34 deletions packages/astro-rss/test/rss.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,16 @@ const phpFeedItem = {
link: '/php',
title: 'Remember PHP?',
pubDate: '1994-05-03',
description: 'PHP is a general-purpose scripting language geared toward web development. It was originally created by Danish-Canadian programmer Rasmus Lerdorf in 1994.',
description:
'PHP is a general-purpose scripting language geared toward web development. It was originally created by Danish-Canadian programmer Rasmus Lerdorf in 1994.',
};

const web1FeedItem = {
link: '/web1',
title: 'Web 1.0',
pubDate: '1997-05-03',
description: 'Web 1.0 is the term used for the earliest version of the Internet as it emerged from its origins with Defense Advanced Research Projects Agency (DARPA) and became, for the first time, a global network representing the future of digital communications.',
description:
'Web 1.0 is the term used for the earliest version of the Internet as it emerged from its origins with Defense Advanced Research Projects Agency (DARPA) and became, for the first time, a global network representing the future of digital communications.',
};

// note: I spent 30 minutes looking for a nice node-based snapshot tool
Expand All @@ -46,27 +48,33 @@ describe('rss', () => {
});

chai.expect(body).to.equal(validXmlResult);
})
});

describe('glob result', () => {
it('should generate on valid result', async () => {
const globResult = {
'./posts/php.md': () => new Promise(resolve => resolve({
url: phpFeedItem.link,
frontmatter: {
title: phpFeedItem.title,
pubDate: phpFeedItem.pubDate,
description: phpFeedItem.description,
},
})),
'./posts/nested/web1.md': () => new Promise(resolve => resolve({
url: web1FeedItem.link,
frontmatter: {
title: web1FeedItem.title,
pubDate: web1FeedItem.pubDate,
description: web1FeedItem.description,
},
})),
'./posts/php.md': () =>
new Promise((resolve) =>
resolve({
url: phpFeedItem.link,
frontmatter: {
title: phpFeedItem.title,
pubDate: phpFeedItem.pubDate,
description: phpFeedItem.description,
},
})
),
'./posts/nested/web1.md': () =>
new Promise((resolve) =>
resolve({
url: web1FeedItem.link,
frontmatter: {
title: web1FeedItem.title,
pubDate: web1FeedItem.pubDate,
description: web1FeedItem.description,
},
})
),
};

const { body } = await rss({
Expand All @@ -81,13 +89,16 @@ describe('rss', () => {

it('should fail on missing "title" key', () => {
const globResult = {
'./posts/php.md': () => new Promise(resolve => resolve({
url: phpFeedItem.link,
frontmatter: {
pubDate: phpFeedItem.pubDate,
description: phpFeedItem.description,
},
})),
'./posts/php.md': () =>
new Promise((resolve) =>
resolve({
url: phpFeedItem.link,
frontmatter: {
pubDate: phpFeedItem.pubDate,
description: phpFeedItem.description,
},
})
),
};
return chai.expect(
rss({
Expand All @@ -101,13 +112,16 @@ describe('rss', () => {

it('should fail on missing "pubDate" key', () => {
const globResult = {
'./posts/php.md': () => new Promise(resolve => resolve({
url: phpFeedItem.link,
frontmatter: {
title: phpFeedItem.title,
description: phpFeedItem.description,
},
})),
'./posts/php.md': () =>
new Promise((resolve) =>
resolve({
url: phpFeedItem.link,
frontmatter: {
title: phpFeedItem.title,
description: phpFeedItem.description,
},
})
),
};
return chai.expect(
rss({
Expand All @@ -119,4 +133,4 @@ describe('rss', () => {
).to.be.rejected;
});
});
})
});

0 comments on commit 204ff2c

Please sign in to comment.