Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitfa641d7

Browse files
committed
summary parse test
Signed-off-by: shmck <shawn.j.mckay@gmail.com>
1 parente27add1 commitfa641d7

File tree

4 files changed

+30
-3
lines changed

4 files changed

+30
-3
lines changed

‎package.json

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,13 @@
4343
},
4444
"jest": {
4545
"preset":"ts-jest",
46-
"testEnvironment":"node"
46+
"verbose":true,
47+
"testPathIgnorePatterns": [
48+
"build"
49+
],
50+
"moduleFileExtensions": [
51+
"js",
52+
"ts"
53+
]
4754
}
4855
}

‎src/build.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ const workingDir = "tmp";
1212

1313
typeTutorialContent={};
1414

15-
functionparseContent(md:string):TutorialContent{
15+
exportfunctionparseContent(md:string):TutorialContent{
1616
letstart:number=-1;
1717
constparts:any[]=[];
1818

‎tests/parseMd.test.ts

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
import{parseContent}from"../src/build";
2+
3+
describe("parse",()=>{
4+
it("should parse summary",()=>{
5+
constmd=`# Insert Tutorial's Title here
6+
7+
Short description to be shown as a tutorial's subtitle.
8+
9+
`;
10+
11+
constresult=parseContent(md);
12+
constexpected={
13+
summary:{
14+
description:"Short description to be shown as a tutorial's subtitle.",
15+
title:"Insert Tutorial's Title here",
16+
},
17+
};
18+
expect(result).toEqual(expected);
19+
});
20+
});

‎tsconfig.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,5 +22,5 @@
2222
"removeComments":true,
2323
"skipLibCheck":true
2424
},
25-
"exclude": [".vscode","bin","build","test"]
25+
"exclude": ["node_modules",".vscode","bin","build","tests"]
2626
}

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp