Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
summary parse test
Signed-off-by: shmck <[email protected]>
  • Loading branch information
ShMcK committed May 30, 2020
commit fa641d7a1f44e6440d6ca7532489446f2b39e1d7
9 changes: 8 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,13 @@
},
"jest": {
"preset": "ts-jest",
"testEnvironment": "node"
"verbose": true,
"testPathIgnorePatterns": [
"build"
],
"moduleFileExtensions": [
"js",
"ts"
]
}
}
2 changes: 1 addition & 1 deletion src/build.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ const workingDir = "tmp";

type TutorialContent = {};

function parseContent(md: string): TutorialContent {
export function parseContent(md: string): TutorialContent {
let start: number = -1;
const parts: any[] = [];

Expand Down
20 changes: 20 additions & 0 deletions tests/parseMd.test.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
import { parseContent } from "../src/build";

describe("parse", () => {
it("should parse summary", () => {
const md = `# Insert Tutorial's Title here

Short description to be shown as a tutorial's subtitle.

`;

const result = parseContent(md);
const expected = {
summary: {
description: "Short description to be shown as a tutorial's subtitle.",
title: "Insert Tutorial's Title here",
},
};
expect(result).toEqual(expected);
});
});
2 changes: 1 addition & 1 deletion tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,5 +22,5 @@
"removeComments": true,
"skipLibCheck": true
},
"exclude": [".vscode", "bin", "build", "test"]
"exclude": ["node_modules", ".vscode", "bin", "build", "tests"]
}