|
6 | 6 | import * as assert from 'assert'; |
7 | 7 | import * as marked from 'marked'; |
8 | 8 | import { PlainTextRenderer } from '../../github/markdownUtils'; |
| 9 | +import { describe, it } from 'mocha'; |
9 | 10 |
|
10 | | -suite('PlainTextRenderer', () => { |
11 | | - test('should escape inline code by default', () => { |
| 11 | +describe('PlainTextRenderer', () => { |
| 12 | + it('should escape inline code by default', () => { |
12 | 13 | const renderer = new PlainTextRenderer(); |
13 | 14 | const result = marked.parse('rename the `Foo` class', { renderer, smartypants: true }); |
14 | 15 | assert.strictEqual(result.trim(), 'rename the \\`Foo\\` class'); |
15 | 16 | }); |
16 | 17 |
|
17 | | - test('should preserve inline code when allowSimpleMarkdown is true', () => { |
| 18 | + it('should preserve inline code when allowSimpleMarkdown is true', () => { |
18 | 19 | const renderer = new PlainTextRenderer(true); |
19 | 20 | const result = marked.parse('rename the `Foo` class', { renderer, smartypants: true }); |
20 | 21 | assert.strictEqual(result.trim(), 'rename the `Foo` class'); |
21 | 22 | }); |
22 | 23 |
|
23 | | - test('should handle multiple inline code spans', () => { |
| 24 | + it('should handle multiple inline code spans', () => { |
24 | 25 | const renderer = new PlainTextRenderer(true); |
25 | 26 | const result = marked.parse('rename the `Foo` class to `Bar`', { renderer, smartypants: true }); |
26 | 27 | assert.strictEqual(result.trim(), 'rename the `Foo` class to `Bar`'); |
27 | 28 | }); |
28 | 29 |
|
29 | | - test('should still escape when allowSimpleMarkdown is false', () => { |
| 30 | + it('should still escape when allowSimpleMarkdown is false', () => { |
30 | 31 | const renderer = new PlainTextRenderer(false); |
31 | 32 | const result = marked.parse('rename the `Foo` class to `Bar`', { renderer, smartypants: true }); |
32 | 33 | assert.strictEqual(result.trim(), 'rename the \\`Foo\\` class to \\`Bar\\`'); |
33 | 34 | }); |
34 | 35 |
|
35 | | - test('should strip all formatting by default', () => { |
| 36 | + it('should strip all formatting by default', () => { |
36 | 37 | const renderer = new PlainTextRenderer(false); |
37 | 38 | const result = marked.parse('rename the `Foo` class to **`Bar`** and make it *italic*', { renderer, smartypants: true }); |
38 | 39 | assert.strictEqual(result.trim(), 'rename the \\`Foo\\` class to \\`Bar\\` and make it italic'); |
|
0 commit comments