File tree Expand file tree Collapse file tree 1 file changed +40
-1
lines changed Expand file tree Collapse file tree 1 file changed +40
-1
lines changed Original file line number Diff line number Diff line change @@ -19,7 +19,7 @@ describe("parse", () => {
1919 expect ( result . summary ) . toEqual ( expected . summary ) ;
2020 } ) ;
2121
22- it ( "should parse a level with a summary " , ( ) => {
22+ it ( "should parse a level with no steps " , ( ) => {
2323 const md = `# Title
2424
2525Description.
@@ -49,4 +49,43 @@ levels:
4949 } ;
5050 expect ( result . levels ) . toEqual ( expected . levels ) ;
5151 } ) ;
52+
53+ it ( "should parse a level with a step" , ( ) => {
54+ const md = `# Title
55+
56+ Description.
57+
58+ ## L1 Put Level's title here
59+
60+ > Level's summary: a short description of the level's content in one line.
61+
62+ Some text
63+ ` ;
64+
65+ const yaml = `version: "0.1.0"
66+ levels:
67+ - id: L1
68+ setup:
69+ files: []
70+ commits: []
71+ solution:
72+ files: []
73+ commits: []
74+ ` ;
75+ const result = parse ( md , yaml ) ;
76+ const expected = {
77+ levels : [
78+ {
79+ id : "L1" ,
80+ title : "Put Level's title here" ,
81+ summary :
82+ "Level's summary: a short description of the level's content in one line." ,
83+ content : "Some text" ,
84+ setup : { files : [ ] , commits : [ ] } ,
85+ solution : { files : [ ] , commits : [ ] } ,
86+ } ,
87+ ] ,
88+ } ;
89+ expect ( result . levels ) . toEqual ( expected . levels ) ;
90+ } ) ;
5291} ) ;
You can’t perform that action at this time.
0 commit comments