const processor = require('../url_to_markdown_processor.js'); const JSDOM = require('jsdom').JSDOM; const test_html_document = "test page" + "

first paragraph

" + "

heading 2

second paragraph

" + "

heading 3

third paragraph

" + "

italics bold

" + "

link

" + "

photo

" + ""; const expected_markdown_output = "# test page\nfirst paragraph\n\nheading 2\n---------\n\nsecond paragraph\n\n" + "### heading 3\n\nthird paragraph\n\n_italics_ **bold**\n\n" + "[link](http://some.url/link)\n\n![photo](http://some.url/img)"; test('process html', () => { const doc = new JSDOM(test_html_document); const res = { header: (header, value) => {} }; const inline_title = true; const ignore_links = false; let actual_markdown_output = processor.process_dom( "http://some.url", doc, res, inline_title, ignore_links ); expect(actual_markdown_output).toBe(expected_markdown_output); })