From 55e970d5b6f7a8fc601447501a98dd2ae5ace1ab Mon Sep 17 00:00:00 2001 From: Vishvamsinh Vaghela Date: Thu, 17 Oct 2024 13:13:56 +0530 Subject: [PATCH] path update --- tests/build-post-list.test.js | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/tests/build-post-list.test.js b/tests/build-post-list.test.js index 7eda419e444b..27ad79267b21 100644 --- a/tests/build-post-list.test.js +++ b/tests/build-post-list.test.js @@ -1,5 +1,5 @@ const { existsSync, readFileSync, writeFileSync, mkdirSync, rmSync } = require('fs'); -const { resolve, join } = require('path'); +const { join } = require('path'); const { buildPostList, slugifyToC } = require('../scripts/build-post-list'); describe('buildPostList', () => { @@ -8,8 +8,8 @@ describe('buildPostList', () => { let postDirectories; beforeEach(() => { - tempDir = resolve(__dirname, `test-config`); - writeFilePath = resolve(tempDir, 'posts.json'); + tempDir = join(__dirname, 'test-config'); + writeFilePath = join(tempDir, 'posts.json'); postDirectories = [ [join(tempDir, 'blog'), '/blog'], [join(tempDir, 'docs'), '/docs'], @@ -159,7 +159,6 @@ describe('buildPostList', () => { expect(error.message).toMatch(/Error while building post list/); }); - it('throws an error if the front matter cannot be parsed', async () => { writeFileSync(join(tempDir, 'docs', 'invalid.mdx'), '---\ninvalid front matter\n---\nContent'); @@ -175,7 +174,6 @@ describe('buildPostList', () => { }); it('throws an error if no post directories are provided', async () => { - let error; try { @@ -187,5 +185,5 @@ describe('buildPostList', () => { expect(error).toBeDefined(); expect(error.message).toMatch(/Error while building post list/); }); - + });