Skip to content

Commit

Permalink
✨ prettier ✨
Browse files Browse the repository at this point in the history
  • Loading branch information
NWylynko committed Mar 10, 2025
1 parent e11d4e4 commit 4bcaf97
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 24 deletions.
42 changes: 21 additions & 21 deletions scripts/build-docs.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -137,33 +137,33 @@ Testing with a simple page.`,
})

test('Warning on missing description in frontmatter', async () => {
// Create temp environment with minimal files array
const { tempDir, pathJoin } = await createTempFiles([
{
path: './docs/manifest.json',
content: JSON.stringify({
navigation: [[{ title: 'Simple Test', href: '/docs/simple-test' }]],
}),
},
{
path: './docs/simple-test.mdx',
content: `---
// Create temp environment with minimal files array
const { tempDir, pathJoin } = await createTempFiles([
{
path: './docs/manifest.json',
content: JSON.stringify({
navigation: [[{ title: 'Simple Test', href: '/docs/simple-test' }]],
}),
},
{
path: './docs/simple-test.mdx',
content: `---
title: Simple Test
---
# Simple Test Page
Testing with a simple page.`,
},
])
const output = await build(
createConfig({
...baseConfig,
basePath: tempDir,
validSdks: ['nextjs', 'react'],
}),
)
},
])

const output = await build(
createConfig({
...baseConfig,
basePath: tempDir,
validSdks: ['nextjs', 'react'],
}),
)

expect(output).toContain('warning Frontmatter should have a "description" property')
})
Expand Down
7 changes: 4 additions & 3 deletions scripts/build-docs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -552,9 +552,10 @@ const parseInMarkdownFile =
// @ts-expect-error - If the heading has a id in it, this will pick it up
// eg # test {{ id: 'my-heading' }}
// This is for remapping the hash to the custom id
const id = node?.children?.find((child) => child?.type === 'mdxTextExpression')?.data?.estree?.body?.find((child) => child?.type === 'ExpressionStatement')?.expression?.properties?.find((prop) => prop?.key?.name === 'id')?.value?.value as
| string
| undefined
const id = node?.children
?.find((child) => child?.type === 'mdxTextExpression')
?.data?.estree?.body?.find((child) => child?.type === 'ExpressionStatement')
?.expression?.properties?.find((prop) => prop?.key?.name === 'id')?.value?.value as string | undefined

if (id !== undefined) {
headingsHashs.push(id)
Expand Down

0 comments on commit 4bcaf97

Please sign in to comment.