Skip to content

Commit 119a9fc

Browse files
committed
test: - Note how to remove a @ts-expect-error in exploratory code
1 parent 17ed1fd commit 119a9fc

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

tests/Obsidian/Cache.test.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -633,10 +633,12 @@ describe('accessing links in file', function () {
633633
});
634634

635635
it('should access links in frontmatter', () => {
636+
// Update to Obsidian API 1.4.0 to access cachedMetadata.frontmatterLinks
636637
// @ts-expect-error TS2551: Property frontmatterLinks does not exist on type CachedMetadata
637638
const frontMatterLinks = cachedMetadata['frontmatterLinks'];
639+
expect(frontMatterLinks).toBeDefined();
638640

639-
const firstFrontMatterLink = frontMatterLinks[0];
641+
const firstFrontMatterLink = frontMatterLinks![0];
640642
expect(firstFrontMatterLink.original).toEqual('[[link_in_yaml]]');
641643
expect(firstFrontMatterLink).toMatchInlineSnapshot(`
642644
{

0 commit comments

Comments
 (0)