diff --git a/.gitignore b/.gitignore index aac64950..f494f3b0 100644 --- a/.gitignore +++ b/.gitignore @@ -11,3 +11,4 @@ node_modules/* .idea .vscode package-lock.json +config.json diff --git a/tests/lib/__snapshots__/markdown.test.js.snap b/tests/lib/__snapshots__/markdown.test.js.snap index 382f4d56..5d04bc4c 100644 --- a/tests/lib/__snapshots__/markdown.test.js.snap +++ b/tests/lib/__snapshots__/markdown.test.js.snap @@ -56,6 +56,26 @@ exports[`Markdown.render() should render shortcuts correctly 1`] = ` " `; +exports[`Markdown.render() should renders [TOC] placholder correctly 1`] = ` +"

+

+

H1

+

H2

+

H3

+

###$ H4

+" +`; + exports[`Markdown.render() should renders KaTeX correctly 1`] = ` "c=pmsqrta2+b2c = pmsqrt{a^2 + b^2}c=pmsqrta2+b2 " diff --git a/tests/lib/markdown.test.js b/tests/lib/markdown.test.js index 3e15cee4..ee93b0ea 100644 --- a/tests/lib/markdown.test.js +++ b/tests/lib/markdown.test.js @@ -1,3 +1,17 @@ +jest.mock( + 'electron', + () => { + return { + remote: { + app: { + getPath: jest.fn().mockReturnValue('.') + } + } + } + }, + { virtual: true } +) + import Markdown from 'browser/lib/markdown' import markdownFixtures from '../fixtures/markdowns' @@ -73,32 +87,32 @@ test('Markdown.render() should render footnote correctly', () => { expect(rendered).toMatchSnapshot() }) -test('Markdown.render() should renders [TOC] placholder correctly', t => { +test('Markdown.render() should renders [TOC] placholder correctly', () => { const rendered = md.render(markdownFixtures.tocPlaceholder) - t.snapshot(rendered) + expect(rendered).toMatchSnapshot() }) -test('Markdown.render() should render PlantUML MindMaps correctly', t => { +test('Markdown.render() should render PlantUML MindMaps correctly', () => { const rendered = md.render(markdownFixtures.plantUmlMindMap) expect(rendered).toMatchSnapshot() }) -test('Markdown.render() should render PlantUML Gantt correctly', t => { +test('Markdown.render() should render PlantUML Gantt correctly', () => { const rendered = md.render(markdownFixtures.plantUmlGantt) expect(rendered).toMatchSnapshot() }) -test('Markdown.render() should render PlantUML WBS correctly', t => { +test('Markdown.render() should render PlantUML WBS correctly', () => { const rendered = md.render(markdownFixtures.plantUmlWbs) expect(rendered).toMatchSnapshot() }) -test('Markdown.render() should render PlantUML Umls correctly', t => { +test('Markdown.render() should render PlantUML Umls correctly', () => { const rendered = md.render(markdownFixtures.plantUmlUml) expect(rendered).toMatchSnapshot() }) -test('Markdown.render() should render PlantUML Ditaa correctly', t => { +test('Markdown.render() should render PlantUML Ditaa correctly', () => { const rendered = md.render(markdownFixtures.plantUmlDitaa) expect(rendered).toMatchSnapshot() })