From ff4e49c5a5fb0a0fc3eb92224cbda29519f18873 Mon Sep 17 00:00:00 2001 From: Farnabaz Date: Wed, 13 Nov 2024 14:29:03 +0100 Subject: [PATCH] test: fix tests --- src/utils/content/index.ts | 2 +- test/unit/defineCollection.test.ts | 16 ++++++++-------- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/src/utils/content/index.ts b/src/utils/content/index.ts index c3a6c2b41..1b1338c66 100644 --- a/src/utils/content/index.ts +++ b/src/utils/content/index.ts @@ -102,7 +102,7 @@ export async function parseContent(key: string, content: string, collection: Res rehypePlugins: { highlight: mdcOptions.highlight === false ? undefined - : await getHighlightPluginInstance({ ...mdcOptions.highlight, compress: true }), + : await getHighlightPluginInstance({ ...mdcOptions.highlight, compress: (mdcOptions as { compress: boolean })?.compress !== false }), ...mdcOptions?.rehypePlugins, ...contentOptions?.rehypePlugins, }, diff --git a/test/unit/defineCollection.test.ts b/test/unit/defineCollection.test.ts index 6eda8048a..e28063fa9 100644 --- a/test/unit/defineCollection.test.ts +++ b/test/unit/defineCollection.test.ts @@ -19,8 +19,8 @@ describe('defineCollection', () => { type: 'page', source: { _resolved: true, - include: '**', - cwd: '~~/content/pages', + include: 'pages/**', + cwd: '', }, }) @@ -62,10 +62,10 @@ describe('defineCollection', () => { expect(collection).toMatchObject({ type: 'page', source: { - include: '**', + include: 'pages/**', prefix: 'blog', exclude: ['pages/blog/index.md'], - cwd: '~~/content/pages', + cwd: '', }, }) @@ -88,8 +88,8 @@ describe('defineCollection', () => { type: 'data', source: { _resolved: true, - include: '**', - cwd: '~~/content/data', + include: 'data/**', + cwd: '', }, }) @@ -116,8 +116,8 @@ describe('defineCollection', () => { expect(collection).toMatchObject({ type: 'data', source: { - include: '**', - cwd: '~~/content/data', + include: 'data/**', + cwd: '', prefix: 'blog', exclude: ['data/blog/index.md'], },