mirror of
https://github.com/cupcakearmy/markdown-it-import.git
synced 2024-12-22 16:26:27 +00:00
25 lines
646 B
TypeScript
25 lines
646 B
TypeScript
import { describe, expect, test } from 'bun:test'
|
|
import { render } from './utils.ts'
|
|
|
|
describe('base', () => {
|
|
test('no imports', async () => {
|
|
expect(await render('simple.md')).toMatchSnapshot()
|
|
})
|
|
|
|
test('single import', async () => {
|
|
expect(await render('whole.md')).toMatchSnapshot()
|
|
})
|
|
|
|
test('multiple imports', async () => {
|
|
expect(await render('multiple.md')).toMatchSnapshot()
|
|
})
|
|
|
|
test('fail on not found', async () => {
|
|
expect(() => render('notFound.md')).toThrow(/cannot locate file.*nirvana\.md/)
|
|
})
|
|
|
|
test('custom lines', async () => {
|
|
expect(await render('partial.md')).toMatchSnapshot()
|
|
})
|
|
})
|