mirror of
https://github.com/immich-app/ui.git
synced 2026-09-30 13:32:54 +08:00
22 lines
699 B
TypeScript
22 lines
699 B
TypeScript
import { basename } from 'node:path';
|
|
import { describe, expect, it } from 'vitest';
|
|
import { svelteMarkdownPreprocess } from '../src/index.js';
|
|
|
|
const fixtureMap: Record<string, { default: string }> = import.meta.glob('./fixtures/*.md', {
|
|
query: '?raw',
|
|
eager: true,
|
|
});
|
|
const fixtures = Object.entries(fixtureMap).map(([filepath, { default: content }]) => ({
|
|
filename: basename(filepath),
|
|
filepath,
|
|
content,
|
|
}));
|
|
|
|
describe('markup', () => {
|
|
it.each(fixtures)('should render $filename correctly', async ({ filename, content }) => {
|
|
const sut = svelteMarkdownPreprocess({});
|
|
const output = await sut.markup({ content, filename });
|
|
expect(output).toMatchSnapshot();
|
|
});
|
|
});
|