Skip to content

Commit

Permalink
.
Browse files Browse the repository at this point in the history
  • Loading branch information
songkg7 committed Jun 28, 2024
1 parent 3622a53 commit 58131f2
Showing 1 changed file with 29 additions and 1 deletion.
30 changes: 29 additions & 1 deletion src/tests/FootnotesConverter.test.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { FootnotesConverter } from '../jekyll/FootnotesConverter';
import { convertFootnotes, FootnotesConverter } from '../jekyll/FootnotesConverter';

const converter = new FootnotesConverter();

Expand Down Expand Up @@ -32,3 +32,31 @@ This is a simple footnote[^fn-nth-1]. next footnote[^fn-nth-2].
it.todo('should convert footnotes with multiple lines');
it.todo('should convert inline footnotes');
});

describe('convertFootnotes', () => {
it('should convert simple footnotes', () => {
const contents = `
# Hello World
This is a simple footnote[^1]. next footnote[^2].
[^1]: meaningful
[^2]: meaningful 2
`;

const expected = `
# Hello World
This is a simple footnote[^fn-nth-1]. next footnote[^fn-nth-2].
[^fn-nth-1]: meaningful
[^fn-nth-2]: meaningful 2
`;
const actual = convertFootnotes(contents);
expect(actual).toEqual(expected);
});
});

0 comments on commit 58131f2

Please sign in to comment.