@@ -437,7 +437,7 @@ The first step
437
437
expect ( result . levels [ 0 ] . steps [ 0 ] ) . toEqual ( expected . levels [ 0 ] . steps [ 0 ] ) ;
438
438
} ) ;
439
439
440
- it ( "should load the full config for a step " , ( ) => {
440
+ it ( "should load the full config for multiple levels & steps " , ( ) => {
441
441
const md = `# Title
442
442
443
443
Description.
@@ -524,12 +524,12 @@ The third step
524
524
text : md ,
525
525
config,
526
526
commits : {
527
- L1S1Q : [ "abcdefg1 " , "123456789" ] ,
528
- L1S1A : [ "1gfedcba " , "987654321" ] ,
529
- L1S2Q : [ "2abcdefg " ] ,
530
- L1S2A : [ "3abcdefg " ] ,
531
- L2S1Q : [ "4abcdefg " ] ,
532
- L2S1A : [ "5abcdefg " ] ,
527
+ L1S1Q : [ "abcdef1 " , "123456789" ] ,
528
+ L1S1A : [ "1fedcba " , "987654321" ] ,
529
+ L1S2Q : [ "2abcdef " ] ,
530
+ L1S2A : [ "3abcdef " ] ,
531
+ L2S1Q : [ "4abcdef " ] ,
532
+ L2S1A : [ "5abcdef " ] ,
533
533
} ,
534
534
} ) ;
535
535
const expected = {
@@ -547,15 +547,15 @@ The third step
547
547
id : "L1S1" ,
548
548
content : "The first step" ,
549
549
setup : {
550
- commits : [ "abcdefg1 " , "123456789" ] ,
550
+ commits : [ "abcdef1 " , "123456789" ] ,
551
551
commands : [ "npm install" ] ,
552
552
files : [ "someFile.js" ] ,
553
553
watchers : [ "someFile.js" ] ,
554
554
filter : "someFilter" ,
555
555
subtasks : true ,
556
556
} ,
557
557
solution : {
558
- commits : [ "1gfedcba " , "987654321" ] ,
558
+ commits : [ "1fedcba " , "987654321" ] ,
559
559
commands : [ "npm install" ] ,
560
560
files : [ "someFile.js" ] ,
561
561
} ,
@@ -564,15 +564,15 @@ The third step
564
564
id : "L1S2" ,
565
565
content : "The second step" ,
566
566
setup : {
567
- commits : [ "2abcdefg " ] ,
567
+ commits : [ "2abcdef " ] ,
568
568
commands : [ "npm install" ] ,
569
569
files : [ "someFile.js" ] ,
570
570
watchers : [ "someFile.js" ] ,
571
571
filter : "someFilter" ,
572
572
subtasks : true ,
573
573
} ,
574
574
solution : {
575
- commits : [ "3abcdefg " ] ,
575
+ commits : [ "3abcdef " ] ,
576
576
commands : [ "npm install" ] ,
577
577
files : [ "someFile.js" ] ,
578
578
} ,
@@ -589,15 +589,15 @@ The third step
589
589
id : "L2S1" ,
590
590
content : "The third step" ,
591
591
setup : {
592
- commits : [ "4abcdefg " ] ,
592
+ commits : [ "4abcdef " ] ,
593
593
commands : [ "npm install" ] ,
594
594
files : [ "someFile.js" ] ,
595
595
watchers : [ "someFile.js" ] ,
596
596
filter : "someFilter" ,
597
597
subtasks : true ,
598
598
} ,
599
599
solution : {
600
- commits : [ "5abcdefg " ] ,
600
+ commits : [ "5abcdef " ] ,
601
601
commands : [ "npm install" ] ,
602
602
files : [ "someFile.js" ] ,
603
603
} ,
@@ -639,7 +639,7 @@ The first step
639
639
text : md ,
640
640
config,
641
641
commits : {
642
- L1S1Q : [ "abcdefg1 " , "123456789" ] ,
642
+ L1S1Q : [ "abcdef1 " , "123456789" ] ,
643
643
} ,
644
644
} ) ;
645
645
const expected = {
@@ -657,7 +657,7 @@ The first step
657
657
id : "L1S1" ,
658
658
content : "The first step" ,
659
659
setup : {
660
- commits : [ "abcdefg1 " , "123456789" ] ,
660
+ commits : [ "abcdef1 " , "123456789" ] ,
661
661
} ,
662
662
} ,
663
663
] ,
@@ -684,7 +684,6 @@ Description.
684
684
} ,
685
685
directory : "coderoad" ,
686
686
setup : {
687
- commits : [ "abcdefg1" ] ,
688
687
commands : [ ] ,
689
688
} ,
690
689
} ,
@@ -721,7 +720,6 @@ Description.
721
720
} ,
722
721
directory : "coderoad" ,
723
722
setup : {
724
- commits : [ "abcdefg1" ] ,
725
723
commands : [ ] ,
726
724
} ,
727
725
} ,
@@ -742,4 +740,76 @@ Description.
742
740
} ;
743
741
expect ( result . config ) . toEqual ( expected . config ) ;
744
742
} ) ;
743
+
744
+ it ( "should parse the tutorial config with INIT commits" , ( ) => {
745
+ const md = `# Title
746
+
747
+ Description.
748
+ ` ;
749
+
750
+ const config = {
751
+ config : {
752
+ testRunner : {
753
+ command : "./node_modules/.bin/mocha" ,
754
+ args : {
755
+ filter : "--grep" ,
756
+ tap : "--reporter=mocha-tap-reporter" ,
757
+ } ,
758
+ directory : "coderoad" ,
759
+ } ,
760
+ appVersions : {
761
+ vscode : ">=0.7.0" ,
762
+ } ,
763
+ repo : {
764
+ uri : "https://path.to/repo" ,
765
+ branch : "aBranch" ,
766
+ } ,
767
+ dependencies : [
768
+ {
769
+ name : "node" ,
770
+ version : ">=10" ,
771
+ } ,
772
+ ] ,
773
+ } ,
774
+ } ;
775
+ const result = parse ( {
776
+ text : md ,
777
+ config,
778
+ commits : {
779
+ INIT : [ "abcdef1" , "123456789" ] ,
780
+ } ,
781
+ } ) ;
782
+ const expected = {
783
+ summary : {
784
+ description : "Description.\n\nSecond description line" ,
785
+ } ,
786
+ config : {
787
+ testRunner : {
788
+ command : "./node_modules/.bin/mocha" ,
789
+ args : {
790
+ filter : "--grep" ,
791
+ tap : "--reporter=mocha-tap-reporter" ,
792
+ } ,
793
+ directory : "coderoad" ,
794
+ setup : {
795
+ commits : [ "abcdef1" , "123456789" ] ,
796
+ } ,
797
+ } ,
798
+ repo : {
799
+ uri : "https://path.to/repo" ,
800
+ branch : "aBranch" ,
801
+ } ,
802
+ dependencies : [
803
+ {
804
+ name : "node" ,
805
+ version : ">=10" ,
806
+ } ,
807
+ ] ,
808
+ appVersions : {
809
+ vscode : ">=0.7.0" ,
810
+ } ,
811
+ } ,
812
+ } ;
813
+ expect ( result . config ) . toEqual ( expected . config ) ;
814
+ } ) ;
745
815
} ) ;
0 commit comments