/**
 * Copyright (c) 2016 - 2022 Alex Grant (@localnerve), LocalNerve LLC
 * Copyrights licensed under the BSD License. See the accompanying LICENSE file for terms.
 * 
 * This mocks remark and remark-html
 */
'use strict';

function Remark () {
}

const testMu = `
<h1>Hello World</h1>
<h2>This is a secondary header</h2>
<p>
This is a paragraph. Woopdie do.
</p>
`;
Remark.prototype = {
  use: (html) => ({
    process: (input, cb) => {
      if (html.mockError) {
        cb(new Error('mock error'));
      } else {
        cb(null, testMu);
      }
    }
  })
}

function remark () {
  return new Remark();
}

module.exports = remark;
