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

Commitb547186

Browse files
committed
setup single hint
Signed-off-by: shmck <shawn.j.mckay@gmail.com>
1 parentdf85d46 commitb547186

File tree

1 file changed

+63
-0
lines changed

1 file changed

+63
-0
lines changed

‎tests/parse.test.ts

Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1189,6 +1189,69 @@ The first step
11891189
expect(result.levels).toEqual(expected.levels);
11901190
});
11911191

1192+
it("should parse a single hint",()=>{
1193+
constmd=`# Title
1194+
1195+
Description.
1196+
1197+
## 1. Title 1
1198+
1199+
First level content.
1200+
1201+
### 1.1
1202+
1203+
The first step
1204+
1205+
#### HINTS
1206+
1207+
- A test with a \`backtick\`
1208+
1209+
`;
1210+
constskeleton={
1211+
levels:[
1212+
{
1213+
id:"1",
1214+
steps:[
1215+
{
1216+
id:"1.1",
1217+
},
1218+
],
1219+
},
1220+
],
1221+
};
1222+
constresult=parse({
1223+
text:md,
1224+
skeleton,
1225+
commits:{
1226+
"1.1:T":["abcdef1","123456789"],
1227+
},
1228+
});
1229+
constexpected={
1230+
summary:{
1231+
description:"Description.",
1232+
},
1233+
levels:[
1234+
{
1235+
id:"1",
1236+
title:"Title 1",
1237+
summary:"First level content.",
1238+
content:"First level content.",
1239+
steps:[
1240+
{
1241+
id:"1.1",
1242+
content:"The first step",
1243+
setup:{
1244+
commits:["abcdef1","123456789"],
1245+
},
1246+
hints:["A test with a `backtick`"],
1247+
},
1248+
],
1249+
},
1250+
],
1251+
};
1252+
expect(result.levels).toEqual(expected.levels);
1253+
});
1254+
11921255
it("should parse hints for a step with '-'",()=>{
11931256
constmd=`# Title
11941257

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp