-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
572a941
commit 8e1f23d
Showing
21 changed files
with
368 additions
and
1,104 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Submodule original-content
updated
18 files
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 2 additions & 2 deletions
4
src/plugins/remark/__snapshots__/extract-description.test.ts.snap
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 2 additions & 2 deletions
4
src/plugins/remark/definition-list/__snapshots__/expand-definitions.test.ts.snap
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 2 additions & 0 deletions
2
src/plugins/remark/definition-list/expand-definitions.test.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1 change: 1 addition & 0 deletions
1
src/plugins/remark/definition-list/stringify-mdast-to-html.test.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
import { describe, expect, it, vi } from 'vitest'; | ||
|
||
import getHierarchy from './get-hierarchy.ts'; | ||
|
||
vi.mock('astro:content', () => ({ | ||
getCollection: vi.fn().mockResolvedValue([ | ||
{ data: { title: 'A' }, slug: 'a' }, | ||
{ data: { title: 'B' }, slug: 'a/b' }, | ||
{ data: { title: 'C' }, slug: 'a/b/c' }, | ||
|
||
{ data: { title: 'D' }, slug: 'd' }, | ||
{ data: { title: 'E' }, slug: 'd/e' }, | ||
{ data: { title: 'F' }, slug: 'd/e/f' }, | ||
|
||
{ data: { title: 'G' }, slug: 'g' }, | ||
]), | ||
})); | ||
|
||
describe('getHierarchy', () => { | ||
it('should return the correct hierarchy', async () => { | ||
const hierarchy = await getHierarchy('processed-content'); | ||
expect(hierarchy).toEqual([ | ||
{ | ||
title: 'A', | ||
slug: 'a', | ||
children: [ | ||
{ | ||
title: 'B', | ||
slug: 'a/b', | ||
children: [ | ||
{ | ||
title: 'C', | ||
slug: 'a/b/c', | ||
children: [], | ||
}, | ||
], | ||
}, | ||
], | ||
}, | ||
{ | ||
title: 'D', | ||
slug: 'd', | ||
children: [ | ||
{ | ||
title: 'E', | ||
slug: 'd/e', | ||
children: [ | ||
{ | ||
title: 'F', | ||
slug: 'd/e/f', | ||
children: [], | ||
}, | ||
], | ||
}, | ||
], | ||
}, | ||
{ | ||
title: 'G', | ||
slug: 'g', | ||
children: [], | ||
}, | ||
]); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.