Skip to content

Commit

Permalink
chore: add ignore and ignore-all unit tests
Browse files Browse the repository at this point in the history
  • Loading branch information
equinusocio committed Jul 30, 2020
1 parent 4ec18fc commit 32efb1f
Showing 1 changed file with 37 additions and 0 deletions.
37 changes: 37 additions & 0 deletions test/unit/render.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -251,6 +251,43 @@ describe('render', function() {
</h6>`
);
});

it('ignore', async function() {
const { docsify } = await init();
const output = docsify.compiler.compile(
'## h2 tag <!-- {docsify-ignore} -->'
);
expectSameDom(
output,
`
<h2 id="h2-tag">
<a href="#/?id=h2-tag" data-id="h2-tag" class="anchor">
<span>h2 tag </span>
</a>
</h2>`
);
});

it('ignore-all', async function() {
const { docsify } = await init();
const output = docsify.compiler.compile(
`# h1 tag <!-- {docsify-ignore-all} -->` + `\n## h2 tag`
);
expectSameDom(
output,
`
<h1 id="h1-tag">
<a href="#/?id=h1-tag" data-id="h1-tag" class="anchor">
<span>h1 tag </span>
</a>
</h1>
<h2 id="h2-tag">
<a href="#/?id=h2-tag" data-id="h2-tag" class="anchor">
<span>h2 tag</span>
</a>
</h2>`
);
});
});

describe('link', function() {
Expand Down

0 comments on commit 32efb1f

Please sign in to comment.