From c8e7e44e09c4cedff2f454f39a8d40012338d7a7 Mon Sep 17 00:00:00 2001 From: Aditya Patil - Parallel Minds Date: Tue, 17 Dec 2024 10:41:10 +0530 Subject: [PATCH] fix: issues suggested by coderabbitai --- scripts/markdown/check-markdown.js | 9 +-------- tests/markdown/check-markdown.test.js | 11 ++--------- 2 files changed, 3 insertions(+), 17 deletions(-) diff --git a/scripts/markdown/check-markdown.js b/scripts/markdown/check-markdown.js index 6acdf9154e6..9abce4c48df 100644 --- a/scripts/markdown/check-markdown.js +++ b/scripts/markdown/check-markdown.js @@ -58,14 +58,7 @@ function isValidURL(str) { * @returns {string[]|null} An array of validation error messages, or null if no errors. */ function validateBlogs(frontmatter) { - const requiredAttributes = [ - 'title', - 'date', - 'type', - 'tags', - 'cover', - 'authors', - ]; + const requiredAttributes = ['title', 'date', 'type', 'tags', 'cover', 'authors']; const errors = []; // Check for required attributes diff --git a/tests/markdown/check-markdown.test.js b/tests/markdown/check-markdown.test.js index 5966517f839..095195877f8 100644 --- a/tests/markdown/check-markdown.test.js +++ b/tests/markdown/check-markdown.test.js @@ -195,11 +195,7 @@ describe('Frontmatter Validator', () => { await checkMarkdownFiles(tempDir, validateDocs, '', pLimit(10)); - expect(mockConsoleLog).not.toHaveBeenCalledWith( - expect.stringContaining( - 'Errors in file reference/specification/skipped.md', - ), - ); + expect(mockConsoleLog).not.toHaveBeenCalledWith(expect.stringContaining('Errors in file reference/specification/skipped.md')); mockConsoleLog.mockRestore(); }); @@ -227,10 +223,7 @@ describe('Frontmatter Validator', () => { expect(mockProcessExit).toHaveBeenCalledWith(1); - expect(mockConsoleError).toHaveBeenCalledWith( - 'Failed to validate markdown files:', - expect.any(Error), - ); + expect(mockConsoleError).toHaveBeenCalledWith('Failed to validate markdown files:',expect.any(Error)); }); it('should handle successful main function execution', async () => {