pagesGlobToRssItems.test.js — astro Source File
Architecture documentation for pagesGlobToRssItems.test.js, a javascript file in the astro codebase. 4 imports, 0 dependents.
Entity Profile
Dependency Diagram
graph LR 8907484f_9222_fa07_2c48_64f2268467d0["pagesGlobToRssItems.test.js"] 410470b6_1217_c12f_a63f_fe972fcaa82d["../dist/index.js"] 8907484f_9222_fa07_2c48_64f2268467d0 --> 410470b6_1217_c12f_a63f_fe972fcaa82d a937f291_aca0_972e_b1ce_ba5bbe7ea3d3["test-utils.js"] 8907484f_9222_fa07_2c48_64f2268467d0 --> a937f291_aca0_972e_b1ce_ba5bbe7ea3d3 e1e2fac7_5a95_7a88_cb1e_0a3b91c4e607["strict"] 8907484f_9222_fa07_2c48_64f2268467d0 --> e1e2fac7_5a95_7a88_cb1e_0a3b91c4e607 6b0635f9_51ea_77aa_767b_7857878e98a6["node:test"] 8907484f_9222_fa07_2c48_64f2268467d0 --> 6b0635f9_51ea_77aa_767b_7857878e98a6 style 8907484f_9222_fa07_2c48_64f2268467d0 fill:#6366f1,stroke:#818cf8,color:#fff
Relationship Graph
Source Code
import assert from 'node:assert/strict';
import { describe, it } from 'node:test';
import { pagesGlobToRssItems } from '../dist/index.js';
import { phpFeedItem, web1FeedItem } from './test-utils.js';
describe('pagesGlobToRssItems', () => {
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,
},
}),
),
};
const items = await pagesGlobToRssItems(globResult);
const expected = [
{
title: phpFeedItem.title,
link: phpFeedItem.link,
pubDate: new Date(phpFeedItem.pubDate),
description: phpFeedItem.description,
},
{
title: web1FeedItem.title,
link: web1FeedItem.link,
pubDate: new Date(web1FeedItem.pubDate),
description: web1FeedItem.description,
},
];
assert.deepEqual(
items.sort((a, b) => a.pubDate - b.pubDate),
expected,
);
});
it('should fail on missing "url"', () => {
const globResult = {
'./posts/php.md': () =>
new Promise((resolve) =>
resolve({
// ... (63 more lines)
Domain
Dependencies
- ../dist/index.js
- node:test
- strict
- test-utils.js
Source
Frequently Asked Questions
What does pagesGlobToRssItems.test.js do?
pagesGlobToRssItems.test.js is a source file in the astro codebase, written in javascript. It belongs to the CoreAstro domain.
What does pagesGlobToRssItems.test.js depend on?
pagesGlobToRssItems.test.js imports 4 module(s): ../dist/index.js, node:test, strict, test-utils.js.
Where is pagesGlobToRssItems.test.js in the architecture?
pagesGlobToRssItems.test.js is located at packages/astro-rss/test/pagesGlobToRssItems.test.js (domain: CoreAstro, directory: packages/astro-rss/test).
Analyze Your Own Codebase
Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.
Try Supermodel Free