mirror of
https://github.com/withastro/astro.git
synced 2025-01-27 22:19:04 -05:00
[ci] format
This commit is contained in:
parent
d864e0991e
commit
971cfe52ae
2 changed files with 9 additions and 5 deletions
|
@ -93,7 +93,12 @@ export function glob(globOptions: GlobOptions): Loader {
|
|||
const isLegacy = (globOptions as any)._legacy;
|
||||
// If global legacy collection handling flag is *not* enabled then this loader is used to emulate them instead
|
||||
const emulateLegacyCollections = !config.legacy.collections;
|
||||
async function syncData(entry: string, base: URL, entryType?: ContentEntryType, oldId?: string) {
|
||||
async function syncData(
|
||||
entry: string,
|
||||
base: URL,
|
||||
entryType?: ContentEntryType,
|
||||
oldId?: string,
|
||||
) {
|
||||
if (!entryType) {
|
||||
logger.warn(`No entry type found for ${entry}`);
|
||||
return;
|
||||
|
@ -116,7 +121,7 @@ export function glob(globOptions: GlobOptions): Loader {
|
|||
|
||||
const id = generateId({ entry, base, data });
|
||||
|
||||
if(oldId && oldId !== id) {
|
||||
if (oldId && oldId !== id) {
|
||||
store.delete(oldId);
|
||||
}
|
||||
|
||||
|
|
|
@ -486,16 +486,15 @@ describe('Content Layer', () => {
|
|||
|
||||
await fixture.editFile('/src/content/space/exomars.md', (prev) => {
|
||||
return prev.replace('rosalind-franklin-rover', 'rosalind-franklin');
|
||||
})
|
||||
});
|
||||
|
||||
await fixture.onNextDataStoreChange();
|
||||
const updatedJsonResponse2 = await fixture.fetch('/collections.json');
|
||||
const updated2 = devalue.parse(await updatedJsonResponse2.text());
|
||||
assert.ok(!updated2.spacecraft.includes('rosalind-franklin-rover'));
|
||||
assert.ok(updated2.spacecraft.includes('rosalind-franklin'));
|
||||
|
||||
await fixture.resetAllFiles();
|
||||
|
||||
await fixture.resetAllFiles();
|
||||
});
|
||||
|
||||
it('returns an error if we render an undefined entry', async () => {
|
||||
|
|
Loading…
Add table
Reference in a new issue