@@ -299,7 +299,7 @@ The first step
299
299
text : md ,
300
300
skeleton,
301
301
commits : {
302
- "1.1Q " : [ "abcdefg1" ] ,
302
+ "1.1:T " : [ "abcdefg1" ] ,
303
303
} ,
304
304
} ) ;
305
305
const expected = {
@@ -355,7 +355,7 @@ The first step
355
355
text : md ,
356
356
skeleton,
357
357
commits : {
358
- "1.1Q " : [ "abcdefg1" , "123456789" ] ,
358
+ "1.1:T " : [ "abcdefg1" , "123456789" ] ,
359
359
} ,
360
360
} ) ;
361
361
const expected = {
@@ -465,7 +465,7 @@ Another line
465
465
skeleton,
466
466
commits : {
467
467
"1" : [ "abcdefg1" ] ,
468
- "1.1Q " : [ "12345678" ] ,
468
+ "1.1:T " : [ "12345678" ] ,
469
469
} ,
470
470
} ) ;
471
471
const expected = {
@@ -519,8 +519,8 @@ The first step
519
519
text : md ,
520
520
skeleton,
521
521
commits : {
522
- "1.1Q " : [ "abcdefg1" , "123456789" ] ,
523
- "1.1A " : [ "1gfedcba" , "987654321" ] ,
522
+ "1.1:T " : [ "abcdefg1" , "123456789" ] ,
523
+ "1.1:S " : [ "1gfedcba" , "987654321" ] ,
524
524
} ,
525
525
} ) ;
526
526
const expected = {
@@ -644,12 +644,12 @@ The third step
644
644
text : md ,
645
645
skeleton,
646
646
commits : {
647
- "1.1Q " : [ "abcdef1" , "123456789" ] ,
648
- "1.1A " : [ "1fedcba" , "987654321" ] ,
649
- "1.2Q " : [ "2abcdef" ] ,
650
- "1.2A " : [ "3abcdef" ] ,
651
- "2.1Q " : [ "4abcdef" ] ,
652
- "2.1A " : [ "5abcdef" ] ,
647
+ "1.1:T " : [ "abcdef1" , "123456789" ] ,
648
+ "1.1:S " : [ "1fedcba" , "987654321" ] ,
649
+ "1.2:T " : [ "2abcdef" ] ,
650
+ "1.2:S " : [ "3abcdef" ] ,
651
+ "2.1:T " : [ "4abcdef" ] ,
652
+ "2.1:S " : [ "5abcdef" ] ,
653
653
} ,
654
654
} ) ;
655
655
const expected = {
@@ -759,7 +759,7 @@ The first step
759
759
text : md ,
760
760
skeleton,
761
761
commits : {
762
- "1.1Q " : [ "abcdef1" , "123456789" ] ,
762
+ "1.1:T " : [ "abcdef1" , "123456789" ] ,
763
763
} ,
764
764
} ) ;
765
765
const expected = {
@@ -936,7 +936,7 @@ Description.
936
936
} ) ;
937
937
938
938
describe ( "hints" , ( ) => {
939
- it ( "should parse hints for a step" , ( ) => {
939
+ it ( "should parse hints for a step with '* " , ( ) => {
940
940
const md = `# Title
941
941
942
942
Description.
@@ -971,7 +971,71 @@ The first step
971
971
text : md ,
972
972
skeleton,
973
973
commits : {
974
- "1.1Q" : [ "abcdef1" , "123456789" ] ,
974
+ "1.1:T" : [ "abcdef1" , "123456789" ] ,
975
+ } ,
976
+ } ) ;
977
+ const expected = {
978
+ summary : {
979
+ description : "Description." ,
980
+ } ,
981
+ levels : [
982
+ {
983
+ id : "1" ,
984
+ title : "Title 1" ,
985
+ summary : "First level content." ,
986
+ content : "First level content." ,
987
+ steps : [
988
+ {
989
+ id : "1.1" ,
990
+ content : "The first step" ,
991
+ setup : {
992
+ commits : [ "abcdef1" , "123456789" ] ,
993
+ } ,
994
+ hints : [ "First Hint" , "Second Hint" ] ,
995
+ } ,
996
+ ] ,
997
+ } ,
998
+ ] ,
999
+ } ;
1000
+ expect ( result . levels ) . toEqual ( expected . levels ) ;
1001
+ } ) ;
1002
+
1003
+ it ( "should parse hints for a step with '-'" , ( ) => {
1004
+ const md = `# Title
1005
+
1006
+ Description.
1007
+
1008
+ ## 1. Title 1
1009
+
1010
+ First level content.
1011
+
1012
+ ### 1.1
1013
+
1014
+ The first step
1015
+
1016
+ #### HINTS
1017
+
1018
+ - First Hint
1019
+ - Second Hint
1020
+
1021
+ ` ;
1022
+ const skeleton = {
1023
+ levels : [
1024
+ {
1025
+ id : "1" ,
1026
+ steps : [
1027
+ {
1028
+ id : "1.1" ,
1029
+ } ,
1030
+ ] ,
1031
+ } ,
1032
+ ] ,
1033
+ } ;
1034
+ const result = parse ( {
1035
+ text : md ,
1036
+ skeleton,
1037
+ commits : {
1038
+ "1.1:T" : [ "abcdef1" , "123456789" ] ,
975
1039
} ,
976
1040
} ) ;
977
1041
const expected = {
@@ -1040,7 +1104,7 @@ And spans multiple lines.
1040
1104
text : md ,
1041
1105
skeleton,
1042
1106
commits : {
1043
- "1.1Q " : [ "abcdef1" , "123456789" ] ,
1107
+ "1.1:T " : [ "abcdef1" , "123456789" ] ,
1044
1108
} ,
1045
1109
} ) ;
1046
1110
const expected = {
@@ -1119,9 +1183,9 @@ The second uninterrupted step
1119
1183
text : md ,
1120
1184
skeleton,
1121
1185
commits : {
1122
- "1.1Q " : [ "abcdef1" ] ,
1123
- "1.1A " : [ "123456789" ] ,
1124
- "1.2Q " : [ "fedcba1" ] ,
1186
+ "1.1:T " : [ "abcdef1" ] ,
1187
+ "1.1:S " : [ "123456789" ] ,
1188
+ "1.2:T " : [ "fedcba1" ] ,
1125
1189
} ,
1126
1190
} ) ;
1127
1191
const expected = {
0 commit comments