Skip to content

Commit ff4e49c

Browse files
committed
test: fix tests
1 parent 6e53dc2 commit ff4e49c

File tree

2 files changed

+9
-9
lines changed

2 files changed

+9
-9
lines changed

src/utils/content/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ export async function parseContent(key: string, content: string, collection: Res
102102
rehypePlugins: {
103103
highlight: mdcOptions.highlight === false
104104
? undefined
105-
: await getHighlightPluginInstance({ ...mdcOptions.highlight, compress: true }),
105+
: await getHighlightPluginInstance({ ...mdcOptions.highlight, compress: (mdcOptions as { compress: boolean })?.compress !== false }),
106106
...mdcOptions?.rehypePlugins,
107107
...contentOptions?.rehypePlugins,
108108
},

test/unit/defineCollection.test.ts

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,8 @@ describe('defineCollection', () => {
1919
type: 'page',
2020
source: {
2121
_resolved: true,
22-
include: '**',
23-
cwd: '~~/content/pages',
22+
include: 'pages/**',
23+
cwd: '',
2424
},
2525
})
2626

@@ -62,10 +62,10 @@ describe('defineCollection', () => {
6262
expect(collection).toMatchObject({
6363
type: 'page',
6464
source: {
65-
include: '**',
65+
include: 'pages/**',
6666
prefix: 'blog',
6767
exclude: ['pages/blog/index.md'],
68-
cwd: '~~/content/pages',
68+
cwd: '',
6969
},
7070
})
7171

@@ -88,8 +88,8 @@ describe('defineCollection', () => {
8888
type: 'data',
8989
source: {
9090
_resolved: true,
91-
include: '**',
92-
cwd: '~~/content/data',
91+
include: 'data/**',
92+
cwd: '',
9393
},
9494
})
9595

@@ -116,8 +116,8 @@ describe('defineCollection', () => {
116116
expect(collection).toMatchObject({
117117
type: 'data',
118118
source: {
119-
include: '**',
120-
cwd: '~~/content/data',
119+
include: 'data/**',
120+
cwd: '',
121121
prefix: 'blog',
122122
exclude: ['data/blog/index.md'],
123123
},

0 commit comments

Comments
 (0)