Validating MDX Parser Error Handling in GatsbyJS
This test suite validates the parser functionality in Gatsby Recipes, focusing on syntax error detection and validation. It ensures proper handling of MDX content and file component validation within recipe files.
Test Coverage Overview
Implementation Analysis
Technical Details
Best Practices Demonstrated
gatsbyjs/gatsby
deprecated-packages/gatsby-recipes/src/parser/validate.test.js
const validate = require(`./validate`)
const fixture = `
# Hello, world!
---
<File path="here" content="there" />
<File path="here" content="there" /
`
// XXX: This needs to be updated for MDX v2, there error will be native
// from the parser and we're currently swallowing it
test.skip(`validate returns a syntax error`, () => {
const result = validate(fixture)
expect(result.line).toEqual(7)
expect(result.errorType).toEqual(`parse`)
})