Skip to content

Commit

Permalink
fix(devkit): pass markdown to mdToHtml directly
Browse files Browse the repository at this point in the history
  • Loading branch information
ndrsg committed Aug 23, 2022
1 parent 2af0f4a commit 6b48452
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions packages/devkit/src/lib/markdown.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,17 @@ import { mdToHtml, getHighlightCss } from './markdown';
describe('Request Executor', () => {

it("converts markdown to html", () => {
const result = mdToHtml("./testfiles/hello.md");
const src = readFileSync("./testfiles/hello.md").toString();
const result = mdToHtml(src);
expect(result).toContain("hello");
expect(result).toContain("<");
expect(result).toContain("</");
expect(result).toContain(">");
});

it("highlights code", () => {
const result = mdToHtml("./testfiles/code.md");
const src = readFileSync("./testfiles/code.md").toString();
const result = mdToHtml(src);
writeFileSync("./fileoutput/code.html", result);
expect(result).toContain("hljs");
});
Expand All @@ -21,4 +23,4 @@ describe('Request Executor', () => {
const result = getHighlightCss("github.css");
expect(result).toContain("Light theme as seen on github.com")
})
});
});

0 comments on commit 6b48452

Please sign in to comment.