From 58131f29b504ab04c509a398a2f1dfe802ad2941 Mon Sep 17 00:00:00 2001 From: haril song Date: Fri, 28 Jun 2024 09:35:17 +0900 Subject: [PATCH] . --- src/tests/FootnotesConverter.test.ts | 30 +++++++++++++++++++++++++++- 1 file changed, 29 insertions(+), 1 deletion(-) diff --git a/src/tests/FootnotesConverter.test.ts b/src/tests/FootnotesConverter.test.ts index 59aa056e..6a516fb4 100644 --- a/src/tests/FootnotesConverter.test.ts +++ b/src/tests/FootnotesConverter.test.ts @@ -1,4 +1,4 @@ -import { FootnotesConverter } from '../jekyll/FootnotesConverter'; +import { convertFootnotes, FootnotesConverter } from '../jekyll/FootnotesConverter'; const converter = new FootnotesConverter(); @@ -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); + }); +});