Skip to content

Commit

Permalink
fix: issues suggested by coderabbitai
Browse files Browse the repository at this point in the history
  • Loading branch information
Aditya0733 committed Dec 17, 2024
1 parent e9efe75 commit c8e7e44
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 17 deletions.
9 changes: 1 addition & 8 deletions scripts/markdown/check-markdown.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
11 changes: 2 additions & 9 deletions tests/markdown/check-markdown.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -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();
});

Expand Down Expand Up @@ -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 () => {
Expand Down

0 comments on commit c8e7e44

Please sign in to comment.