Skip to content

Commit

Permalink
test: test
Browse files Browse the repository at this point in the history
  • Loading branch information
kellyjosephprice committed Jan 28, 2025
1 parent 77f3228 commit f56f690
Showing 1 changed file with 24 additions and 0 deletions.
24 changes: 24 additions & 0 deletions __tests__/lib/run.test.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
import React from 'react';
import { render, screen } from '@testing-library/react';

import { execute } from '../helpers';

describe('run', () => {
it('allows providing imports', async () => {
const mdx = `Hello, world!`;
const Component = await execute(mdx, {}, { imports: { React } });

render(<Component />);

expect(screen.getByText('Hello, world!')).toBeInTheDocument();
});

it('merges the imports with the built-ins', async () => {
const mdx = `{user.test}`;
const Component = await execute(mdx, {}, { imports: { React } });

render(<Component />);

expect(screen.getByText('TEST')).toBeInTheDocument();
});
});

0 comments on commit f56f690

Please sign in to comment.