Skip to content

Commit

Permalink
test: - Note how to remove a @ts-expect-error in exploratory code
Browse files Browse the repository at this point in the history
  • Loading branch information
claremacrae committed Nov 22, 2024
1 parent 17ed1fd commit 119a9fc
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion tests/Obsidian/Cache.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -633,10 +633,12 @@ describe('accessing links in file', function () {
});

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

const firstFrontMatterLink = frontMatterLinks[0];
const firstFrontMatterLink = frontMatterLinks![0];
expect(firstFrontMatterLink.original).toEqual('[[link_in_yaml]]');
expect(firstFrontMatterLink).toMatchInlineSnapshot(`
{
Expand Down

0 comments on commit 119a9fc

Please sign in to comment.