From 8d9712ea85aeda21e0f8397f35c8b75d673452bc Mon Sep 17 00:00:00 2001 From: ivan Date: Wed, 22 Nov 2023 15:07:39 +0300 Subject: [PATCH] test: improve block anchor spec --- test/block-anchor.test.ts | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/test/block-anchor.test.ts b/test/block-anchor.test.ts index 7b9ddc02..e3b189c4 100644 --- a/test/block-anchor.test.ts +++ b/test/block-anchor.test.ts @@ -17,8 +17,18 @@ describe('block-anchor', function () { expect(transformYfm('{%anchor my-anchor%}')).toBe(''); }); it('does not consume things it should not', () => { - expect(transformYfm('# Heading \n {%anchor my-anchor%} \n # Other heading')).toContain( - 'Other heading', + expect(transformYfm('# Heading \n {%anchor my-anchor%} \n # Other heading')).toEqual( + '

Heading

\n' + + '

' + + 'Other heading

\n', + ); + }); + + it('does not match an anchor if theres something right in front of it', () => { + expect(transformYfm('${%anchor my-anchor} Content')).toEqual( + '

${%anchor my-anchor} Content

\n', ); }); });