-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
c62dbfd
commit ab8e86c
Showing
35 changed files
with
172 additions
and
167 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,47 +1,64 @@ | ||
import { mdast } from '../../../lib'; | ||
|
||
// @ts-expect-error - these are being imported as strings | ||
import esmMdx from './esm/in.mdx?raw'; | ||
// @ts-expect-error - these are being imported as json | ||
import esmJson from './esm/out.json'; | ||
// @ts-expect-error - these are being imported as strings | ||
import inlineImagesMdx from './images/inline/in.mdx?raw'; | ||
// @ts-expect-error - these are being imported as json | ||
import inlineImagesJson from './images/inline/out.json'; | ||
// @ts-expect-error - these are being imported as strings | ||
import nullAttributesMdx from './null-attributes/in.mdx?raw'; | ||
// @ts-expect-error - these are being imported as json | ||
import nullAttributesJson from './null-attributes/out.json'; | ||
// @ts-expect-error - these are being imported as strings | ||
import tablesMdx from './tables/in.mdx?raw'; | ||
// @ts-expect-error - these are being imported as json | ||
import tablesJson from './tables/out.json'; | ||
// @ts-expect-error - these are being imported as strings | ||
import variablesMdx from './variables/in.mdx?raw'; | ||
// @ts-expect-error - these are being imported as json | ||
import variablesJson from './variables/out.json'; | ||
// @ts-expect-error - these are being imported as strings | ||
import variablesWithSpacesMdx from './variables-with-spaces/in.mdx?raw'; | ||
// @ts-expect-error - these are being imported as json | ||
import variablesWithSpacesJson from './variables-with-spaces/out.json'; | ||
|
||
|
||
describe('mdast transformer', async () => { | ||
describe('mdast transformer', () => { | ||
it('parses null attributes', () => { | ||
// @ts-ignore | ||
// @ts-expect-error - the custom matcher types are not being set up | ||
// correctly | ||
expect(mdast(nullAttributesMdx)).toStrictEqualExceptPosition(nullAttributesJson); | ||
}); | ||
|
||
it('parses tables', () => { | ||
// @ts-ignore | ||
// @ts-expect-error - the custom matcher types are not being set up | ||
// correctly | ||
expect(mdast(tablesMdx)).toStrictEqualExceptPosition(tablesJson); | ||
}); | ||
|
||
it('parses variables', () => { | ||
// @ts-ignore | ||
// @ts-expect-error - the custom matcher types are not being set up | ||
// correctly | ||
expect(mdast(variablesMdx)).toStrictEqualExceptPosition(variablesJson); | ||
}); | ||
|
||
it('parses variables with spaces', () => { | ||
// @ts-ignore | ||
// @ts-expect-error - the custom matcher types are not being set up | ||
// correctly | ||
expect(mdast(variablesWithSpacesMdx)).toStrictEqualExceptPosition(variablesWithSpacesJson); | ||
}); | ||
|
||
it('parses inline images', () => { | ||
// @ts-ignore | ||
// @ts-expect-error - the custom matcher types are not being set up | ||
// correctly | ||
expect(mdast(inlineImagesMdx)).toStrictEqualExceptPosition(inlineImagesJson); | ||
}); | ||
|
||
it('parses esm (imports and exports)', () => { | ||
// @ts-ignore | ||
// @ts-expect-error - the custom matcher types are not being set up | ||
// correctly | ||
expect(mdast(esmMdx)).toStrictEqualExceptPosition(esmJson); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.