[ci] format
This commit is contained in:
parent
fbfb6190ab
commit
204ff2c223
1 changed files with 48 additions and 34 deletions
|
@ -12,14 +12,16 @@ const phpFeedItem = {
|
||||||
link: '/php',
|
link: '/php',
|
||||||
title: 'Remember PHP?',
|
title: 'Remember PHP?',
|
||||||
pubDate: '1994-05-03',
|
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 = {
|
const web1FeedItem = {
|
||||||
link: '/web1',
|
link: '/web1',
|
||||||
title: 'Web 1.0',
|
title: 'Web 1.0',
|
||||||
pubDate: '1997-05-03',
|
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
|
// note: I spent 30 minutes looking for a nice node-based snapshot tool
|
||||||
|
@ -46,27 +48,33 @@ describe('rss', () => {
|
||||||
});
|
});
|
||||||
|
|
||||||
chai.expect(body).to.equal(validXmlResult);
|
chai.expect(body).to.equal(validXmlResult);
|
||||||
})
|
});
|
||||||
|
|
||||||
describe('glob result', () => {
|
describe('glob result', () => {
|
||||||
it('should generate on valid result', async () => {
|
it('should generate on valid result', async () => {
|
||||||
const globResult = {
|
const globResult = {
|
||||||
'./posts/php.md': () => new Promise(resolve => resolve({
|
'./posts/php.md': () =>
|
||||||
url: phpFeedItem.link,
|
new Promise((resolve) =>
|
||||||
frontmatter: {
|
resolve({
|
||||||
title: phpFeedItem.title,
|
url: phpFeedItem.link,
|
||||||
pubDate: phpFeedItem.pubDate,
|
frontmatter: {
|
||||||
description: phpFeedItem.description,
|
title: phpFeedItem.title,
|
||||||
},
|
pubDate: phpFeedItem.pubDate,
|
||||||
})),
|
description: phpFeedItem.description,
|
||||||
'./posts/nested/web1.md': () => new Promise(resolve => resolve({
|
},
|
||||||
url: web1FeedItem.link,
|
})
|
||||||
frontmatter: {
|
),
|
||||||
title: web1FeedItem.title,
|
'./posts/nested/web1.md': () =>
|
||||||
pubDate: web1FeedItem.pubDate,
|
new Promise((resolve) =>
|
||||||
description: web1FeedItem.description,
|
resolve({
|
||||||
},
|
url: web1FeedItem.link,
|
||||||
})),
|
frontmatter: {
|
||||||
|
title: web1FeedItem.title,
|
||||||
|
pubDate: web1FeedItem.pubDate,
|
||||||
|
description: web1FeedItem.description,
|
||||||
|
},
|
||||||
|
})
|
||||||
|
),
|
||||||
};
|
};
|
||||||
|
|
||||||
const { body } = await rss({
|
const { body } = await rss({
|
||||||
|
@ -81,13 +89,16 @@ describe('rss', () => {
|
||||||
|
|
||||||
it('should fail on missing "title" key', () => {
|
it('should fail on missing "title" key', () => {
|
||||||
const globResult = {
|
const globResult = {
|
||||||
'./posts/php.md': () => new Promise(resolve => resolve({
|
'./posts/php.md': () =>
|
||||||
url: phpFeedItem.link,
|
new Promise((resolve) =>
|
||||||
frontmatter: {
|
resolve({
|
||||||
pubDate: phpFeedItem.pubDate,
|
url: phpFeedItem.link,
|
||||||
description: phpFeedItem.description,
|
frontmatter: {
|
||||||
},
|
pubDate: phpFeedItem.pubDate,
|
||||||
})),
|
description: phpFeedItem.description,
|
||||||
|
},
|
||||||
|
})
|
||||||
|
),
|
||||||
};
|
};
|
||||||
return chai.expect(
|
return chai.expect(
|
||||||
rss({
|
rss({
|
||||||
|
@ -101,13 +112,16 @@ describe('rss', () => {
|
||||||
|
|
||||||
it('should fail on missing "pubDate" key', () => {
|
it('should fail on missing "pubDate" key', () => {
|
||||||
const globResult = {
|
const globResult = {
|
||||||
'./posts/php.md': () => new Promise(resolve => resolve({
|
'./posts/php.md': () =>
|
||||||
url: phpFeedItem.link,
|
new Promise((resolve) =>
|
||||||
frontmatter: {
|
resolve({
|
||||||
title: phpFeedItem.title,
|
url: phpFeedItem.link,
|
||||||
description: phpFeedItem.description,
|
frontmatter: {
|
||||||
},
|
title: phpFeedItem.title,
|
||||||
})),
|
description: phpFeedItem.description,
|
||||||
|
},
|
||||||
|
})
|
||||||
|
),
|
||||||
};
|
};
|
||||||
return chai.expect(
|
return chai.expect(
|
||||||
rss({
|
rss({
|
||||||
|
@ -119,4 +133,4 @@ describe('rss', () => {
|
||||||
).to.be.rejected;
|
).to.be.rejected;
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
})
|
});
|
||||||
|
|
Loading…
Reference in a new issue