From ed194bd5b972435acb75d29171ca81881da2b56e Mon Sep 17 00:00:00 2001 From: Vishvamsinh Vaghela Date: Fri, 18 Oct 2024 13:48:21 +0530 Subject: [PATCH] feqfe --- tests/build-post-list.test.js | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/tests/build-post-list.test.js b/tests/build-post-list.test.js index 4555335361fb..9e702bb8d957 100644 --- a/tests/build-post-list.test.js +++ b/tests/build-post-list.test.js @@ -1,6 +1,9 @@ const { existsSync, readFileSync, writeFileSync, mkdirSync, rmSync } = require('fs'); const { resolve, join } = require('path'); const { buildPostList, slugifyToC } = require('../scripts/build-post-list'); +const { sep } = require('path'); + +const toUrlPath = (path) => path.split(sep).join('/'); describe('buildPostList', () => { let tempDir; @@ -11,9 +14,9 @@ describe('buildPostList', () => { tempDir = resolve(__dirname, `test-config`); writeFilePath = resolve(tempDir, 'posts.json'); postDirectories = [ - [join(tempDir, 'blog'), '/blog'], - [join(tempDir, 'docs'), '/docs'], - [join(tempDir, 'about'), '/about'], + [join(tempDir, 'blog'), toUrlPath('/blog')], + [join(tempDir, 'docs'), toUrlPath('/docs')], + [join(tempDir, 'about'), toUrlPath('/about')], ]; mkdirSync(tempDir, { recursive: true });