import test from 'node:test'; import assert from 'node:assert/strict'; import { remark } from 'remark'; import removeComments from './index.js'; const original = ` Hello this is Markdown and it's a fantastic format. `; const jsxBlock = `References: [README](./README.md), [CONTRIBUTING](./CONTRIBUTING.md)`; test('Removes HTML comment', function (t) { const noComments = remark().use(removeComments).processSync(original).toString(); assert.equal(noComments, `Hello this is Markdown and it's a fantastic format.\n`); }); test('Removes HTML comment in JSX block', function (t) { const noComments = remark().use(removeComments).processSync(jsxBlock).toString(); assert.equal( noComments, `References: [README](./README.md), [CONTRIBUTING](./CONTRIBUTING.md)\n`, ); });