Skip to content

Commit

Permalink
chore(@argdown/pandoc-filter): added test for generating revealjs slides
Browse files Browse the repository at this point in the history
  • Loading branch information
christianvoigt committed Nov 15, 2021
1 parent 0037dae commit 5f4454c
Show file tree
Hide file tree
Showing 3 changed files with 56 additions and 1 deletion.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

46 changes: 46 additions & 0 deletions packages/argdown-pandoc-filter/test/example-revealjs.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
---
title: Reveal Js Test
argdown:
config: "./argdown.config.json"
mode: "web-component"
sourceHighlighter: "web-component"
---

# Test 1

```argdown
===
webComponent:
withoutHeader: true
views:
map: false
source: true
===
[s]
- <a>
```

<div><span>Some really boring html</span></div>

# Test 2

```argdown
===
webComponent:
withoutHeader: true
views:
map: false
source: true
===
[s]
+ <b>
```

# Test 3

```argdown-map
[s]
+ <b>
```
10 changes: 9 additions & 1 deletion packages/argdown-pandoc-filter/test/pandoc-filter.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,10 @@ const chaiSnapshot = require("mocha-chai-snapshot");
use(chaiSnapshot);

// const tis = this;
async function execPandocOnFile(fileName: string, format: "html" | "pdf") {
async function execPandocOnFile(
fileName: string,
format: "html" | "pdf" | "revealjs"
) {
const { stdout } = await exec(
`pandoc -s -f markdown test/${fileName} --filter dist/index.js -t ${format}`
);
Expand Down Expand Up @@ -70,4 +73,9 @@ describe("Argdown Pandoc Filter", function() {
expect(output).to.exist;
expect(output).to.not.be.empty;
});
it("generates revealjs with 3 slides", async () => {
const output = await execPandocOnFile(`example-revealjs.md`, "revealjs");
//(expect(output) as any).to.matchSnapshot(this); // not working
(expect(output) as any).to.matchSnapshot(this);
});
});

0 comments on commit 5f4454c

Please sign in to comment.