Skip to content

Commit

Permalink
Add tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Skalakid committed Jan 16, 2025
1 parent 919259b commit be19fef
Showing 1 changed file with 28 additions and 0 deletions.
28 changes: 28 additions & 0 deletions __tests__/ExpensiMark-HTML-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -1978,6 +1978,34 @@ describe('when should keep raw input flag is enabled', () => {
expect(parser.replace(testString, {shouldKeepRawInput: true})).toBe(resultString);
});
});

describe('inline code blocks', () => {
test('empty content', () => {
const testString = '``';
const resultString = '``';
expect(parser.replace(testString, {shouldKeepRawInput: true})).toBe(resultString);
});
test('single whitespace as a content', () => {
const testString = '` `';
const resultString = '<code> </code>';
expect(parser.replace(testString, {shouldKeepRawInput: true})).toBe(resultString);
});
test('multiple whitespaces as a content', () => {
const testString = '` `';
const resultString = '<code> </code>';
expect(parser.replace(testString, {shouldKeepRawInput: true})).toBe(resultString);
});
test('text content', () => {
const testString = 'hello `world`';
const resultString = 'hello <code>world</code>';
expect(parser.replace(testString, {shouldKeepRawInput: true})).toBe(resultString);
});
test('text and whitespaces as a content', () => {
const testString = '` hello world `';
const resultString = '<code> hello world </code>';
expect(parser.replace(testString, {shouldKeepRawInput: true})).toBe(resultString);
});
});
});

test('Test code fence within inline code', () => {
Expand Down

0 comments on commit be19fef

Please sign in to comment.