Skip to content

Commit

Permalink
Add more test cases
Browse files Browse the repository at this point in the history
  • Loading branch information
jp928 committed Jul 12, 2024
1 parent 068e00c commit 73b6cd4
Showing 1 changed file with 14 additions and 2 deletions.
16 changes: 14 additions & 2 deletions __tests__/ExpensiMark-HTML-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,21 @@ test('Test bold within code blocks is skipped', () => {
expect(parser.replace(testString)).toBe(replacedString);
});

test('Test special character plus _ ahead asterisk still result in bold', () => {
const testString = 'This is a !_*bold*';
const replacedString = 'This is a !_<strong>bold</strong>';
expect(parser.replace(testString)).toBe(replacedString);
});

test('Test a word plus _ ahead asterisk not result in bold', () => {
const testString = 'This is not a_*bold*';
const replacedString = 'This is not a_*bold*';
expect(parser.replace(testString)).toBe(replacedString);
});

test('Test _ ahead asterisk still result in bold', () => {
const testString = 'bold\n```\n*not a bold*\n```\nThis is _*bold*';
const replacedString = 'bold<br /><pre>*not&#32;a&#32;bold*<br /></pre>This is _<strong>bold</strong>';
const testString = 'This is a ~_*bold*';
const replacedString = 'This is a ~_<strong>bold</strong>';
expect(parser.replace(testString)).toBe(replacedString);
});

Expand Down

0 comments on commit 73b6cd4

Please sign in to comment.