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

Commit1441893

Browse files
committed
add out of order id test
Signed-off-by: shmck <shawn.j.mckay@gmail.com>
1 parent0232eaf commit1441893

File tree

1 file changed

+102
-0
lines changed

1 file changed

+102
-0
lines changed

‎tests/parse.test.ts

Lines changed: 102 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -837,6 +837,108 @@ The first step
837837
});
838838
});
839839

840+
it("should load when commits are not in direct order (100, 200, 201)",()=>{
841+
constmd=`# Title
842+
843+
Description.
844+
845+
## 100. Title
846+
847+
First line
848+
849+
### 100.1
850+
851+
The first step
852+
853+
## 200. Title
854+
855+
First line
856+
857+
### 200.1
858+
859+
The first step
860+
861+
## 201. Title
862+
863+
First line
864+
865+
### 201.1
866+
867+
The first step
868+
`;
869+
constskeleton={
870+
levels:[
871+
{
872+
id:"100",
873+
steps:[{id:"100.1"}],
874+
},
875+
{
876+
id:"200",
877+
steps:[{id:"200.1"}],
878+
},
879+
{
880+
id:"201",
881+
steps:[{id:"201.1"}],
882+
},
883+
],
884+
};
885+
constresult=parse({
886+
text:md,
887+
skeleton,
888+
commits:{},
889+
});
890+
constexpected={
891+
summary:{
892+
description:"Description.",
893+
},
894+
levels:[
895+
{
896+
id:"100",
897+
summary:"First line",
898+
content:"First line",
899+
steps:[
900+
{
901+
id:"100.1",
902+
content:"The first step",
903+
setup:{
904+
commits:[],
905+
},
906+
},
907+
],
908+
},
909+
{
910+
id:"200",
911+
summary:"Second line",
912+
content:"Second line",
913+
steps:[
914+
{
915+
id:"200.1",
916+
content:"The second step",
917+
setup:{
918+
commits:[],
919+
},
920+
},
921+
],
922+
},
923+
{
924+
id:"201",
925+
summary:"Third line",
926+
content:"Third line",
927+
steps:[
928+
{
929+
id:"201.1",
930+
content:"The third step",
931+
setup:{
932+
commits:[],
933+
},
934+
},
935+
],
936+
},
937+
],
938+
};
939+
expect(result.levels).toEqual(expected.levels);
940+
});
941+
840942
describe("config",()=>{
841943
it("should parse the tutorial config",()=>{
842944
constmd=`# Title

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp