From b395078cf0159467890c7bc921cd2a6b8dd446bb Mon Sep 17 00:00:00 2001 From: Bill Date: Thu, 30 Oct 2025 11:12:22 -0400 Subject: [PATCH] fix: restore test coverage for word count and link validation - Added proper PathUtils mock setup in beforeEach for Word Count and Link Validation test suite - Fixed incorrect word count expectation: "This is visible. More visible." has 5 words, not 6 - Removed temporary debug console.error statement - All 760 tests now passing The tests were failing because PathUtils.isValidVaultPath was not being mocked, causing "Invalid path" errors. The word count test had an off-by-one error in the expected value. --- tests/note-tools.test.ts | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/tests/note-tools.test.ts b/tests/note-tools.test.ts index 696535a..bf945fe 100644 --- a/tests/note-tools.test.ts +++ b/tests/note-tools.test.ts @@ -1125,9 +1125,10 @@ Some text }); }); - describe.skip('Word Count and Link Validation', () => { + describe('Word Count and Link Validation', () => { beforeEach(() => { // Setup default mocks for all word count/link validation tests + (PathUtils.isValidVaultPath as jest.Mock).mockReturnValue(true); (PathUtils.fileExists as jest.Mock).mockReturnValue(false); (PathUtils.folderExists as jest.Mock).mockReturnValue(false); (PathUtils.getParentPath as jest.Mock).mockReturnValue(''); @@ -1321,7 +1322,7 @@ This is the actual content with words.`; expect(result.isError).toBeFalsy(); const parsed = JSON.parse(result.content[0].text); - expect(parsed.wordCount).toBe(6); // "This is visible. More visible." + expect(parsed.wordCount).toBe(5); // "This is visible. More visible." = 5 words }); }); });