diff --git a/__tests__/compilers/compatability.test.tsx b/__tests__/compilers/compatability.test.tsx index 9d0d8049f..fbe61c377 100644 --- a/__tests__/compilers/compatability.test.tsx +++ b/__tests__/compilers/compatability.test.tsx @@ -1,10 +1,9 @@ import React from 'react'; import fs from 'node:fs'; import { vi } from 'vitest'; -import { render, screen, prettyDOM, configure } from '@testing-library/react'; +import { render, screen } from '@testing-library/react'; -import { mdx, compile, run } from '../../index'; -import * as rdmd from '@readme/markdown-legacy'; +import { mdastV6, mdx, compile, run } from '../../index'; describe('compatability with RDMD', () => { it('compiles glossary nodes', () => { @@ -126,7 +125,7 @@ describe('compatability with RDMD', () => { This is some in progress `; - expect(mdx(rdmd.mdast(md)).trim()).toBe('This is some in progress {/* commented out stuff */}'); + expect(mdx(mdastV6(md)).trim()).toBe('This is some in progress {/* commented out stuff */}'); }); it('compiles multi-line html comments to JSX comments', () => { @@ -140,7 +139,7 @@ This is some in progress --> `; - expect(mdx(rdmd.mdast(md)).trim()).toMatchInlineSnapshot(` + expect(mdx(mdastV6(md)).trim()).toMatchInlineSnapshot(` "## Wip {/* @@ -156,7 +155,7 @@ This is some in progress This is a break:
`; - expect(mdx(rdmd.mdast(md)).trim()).toBe('This is a break:
'); + expect(mdx(mdastV6(md)).trim()).toBe('This is a break:
'); }); it.skip('closes un-closed self closing tags with a space', () => { @@ -164,7 +163,7 @@ This is a break:
This is a break:
`; - expect(mdx(rdmd.mdast(md)).trim()).toBe('This is a break:
'); + expect(mdx(mdastV6(md)).trim()).toBe('This is a break:
'); }); it.skip('closes complex un-closed self closing tags', () => { @@ -172,7 +171,7 @@ This is a break:
This is an image: `; - expect(mdx(rdmd.mdast(md)).trim()).toBe('This is an image: '); + expect(mdx(mdastV6(md)).trim()).toBe('This is an image: '); }); it('compiles escapes', () => { @@ -180,7 +179,7 @@ This is an image: \\- not a list item `; - expect(mdx(rdmd.mdast(md)).trim()).toBe('\\- not a list item'); + expect(mdx(mdastV6(md)).trim()).toBe('\\- not a list item'); }); it('compiles escapes of backslashes', () => { @@ -188,20 +187,20 @@ This is an image: \\\\**still emphatic** `; - expect(mdx(rdmd.mdast(md)).trim()).toBe('\\\\**still emphatic**'); + expect(mdx(mdastV6(md)).trim()).toBe('\\\\**still emphatic**'); }); it('compiles magic block images into blocks', () => { const imageMd = fs.readFileSync('__tests__/fixtures/image-block-no-attrs.md', { encoding: 'utf8' }); const imageMdx = fs.readFileSync('__tests__/fixtures/image-block-no-attrs.mdx', { encoding: 'utf8' }); - expect(mdx(rdmd.mdast(imageMd))).toBe(imageMdx); + expect(mdx(mdastV6(imageMd))).toBe(imageMdx); }); it('compiles user variables', () => { const md = `Contact me at <>`; - expect(mdx(rdmd.mdast(md))).toBe(`Contact me at {user.email}\n`); + expect(mdx(mdastV6(md))).toBe(`Contact me at {user.email}\n`); }); describe(' wrapping', () => { @@ -225,7 +224,7 @@ This is an image: `; it('should wrap raw