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

Commit504103a

Browse files
committed
setup tests
Signed-off-by: shmck <shawn.j.mckay@gmail.com>
1 parentb34375b commit504103a

File tree

5 files changed

+118
-118
lines changed

5 files changed

+118
-118
lines changed

‎tests/commitOrder.test.ts

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -2,45 +2,45 @@ import { validateCommitOrder } from "../src/utils/validateCommits";
22

33
describe("commitOrder",()=>{
44
it("should return true if order is valid",()=>{
5-
constpositions=["INIT","L1","L1S1","L1S2","L2","L2S1"];
5+
constpositions=["INIT","1","1.1","1.2","2","2.1"];
66
constresult=validateCommitOrder(positions);
77
expect(result).toBe(true);
88
});
99
it("should return true if valid with duplicates",()=>{
1010
constpositions=[
1111
"INIT",
1212
"INIT",
13-
"L1",
14-
"L1",
15-
"L1S1",
16-
"L1S1",
17-
"L1S2",
18-
"L1S2",
19-
"L2",
20-
"L2",
21-
"L2S1",
22-
"L2S1",
13+
"1",
14+
"1",
15+
"1.1",
16+
"1.1",
17+
"1.2",
18+
"1.2",
19+
"2",
20+
"2",
21+
"2.1",
22+
"2.1",
2323
];
2424
constresult=validateCommitOrder(positions);
2525
expect(result).toBe(true);
2626
});
2727
it("should return false if INIT is out of order",()=>{
28-
constpositions=["INIT","L1","L1S1","L1S2","INIT","L2","L2S1"];
28+
constpositions=["INIT","1","1.1","1.2","INIT","2","2.1"];
2929
constresult=validateCommitOrder(positions);
3030
expect(result).toBe(false);
3131
});
3232
it("should return false if level after step is out of order",()=>{
33-
constpositions=["INIT","L1","L1S1","L1S2","L2S1","L2"];
33+
constpositions=["INIT","1","1.1","1.2","2.1","2"];
3434
constresult=validateCommitOrder(positions);
3535
expect(result).toBe(false);
3636
});
3737
it("should return false if level is out of order",()=>{
38-
constpositions=["INIT","L1","L3","L2"];
38+
constpositions=["INIT","1","L3","2"];
3939
constresult=validateCommitOrder(positions);
4040
expect(result).toBe(false);
4141
});
4242
it("should return false if step is out of order",()=>{
43-
constpositions=["INIT","L1","L1S1","L1S3","L1S2"];
43+
constpositions=["INIT","1","1.1","1.3","1.2"];
4444
constresult=validateCommitOrder(positions);
4545
expect(result).toBe(false);
4646
});

‎tests/markdown.test.ts

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ describe("validate markdown", () => {
55
constmd=`
66
Description.
77
8-
##L1Put Level's title here
8+
## Put Level's title here
99
1010
> Level's summary: a short description of the level's content in one line.
1111
@@ -19,7 +19,7 @@ Description.
1919
2020
# Another Title
2121
22-
##L1Put Level's title here
22+
## Put Level's title here
2323
2424
> Level's summary: a short description of the level's content in one line.
2525
@@ -29,7 +29,7 @@ Some text that describes the level`;
2929
Description.
3030
3131
32-
##L1Put Level's title here
32+
## Put Level's title here
3333
3434
> Level's summary: a short description of the level's content in one line.
3535
@@ -45,7 +45,7 @@ Some text that describes the level
4545
it("should return false if missing a summary description",()=>{
4646
constmd=`# A Title
4747
48-
##L1Put Level's title here
48+
## Put Level's title here
4949
5050
> Level's summary: a short description of the level's content in one line.
5151
@@ -90,13 +90,13 @@ First step
9090
9191
Description.
9292
93-
##L1Put Level's title here
93+
## Put Level's title here
9494
9595
> Level's summary: a short description of the level's content in one line.
9696
9797
Some text that describes the level
9898
99-
###L1S1
99+
###Step 1
100100
101101
First Step`;
102102
expect(validateMarkdown(md)).toBe(true);
@@ -114,7 +114,7 @@ Should not be a problem
114114
\`\`\`
115115
116116
117-
##L1Put Level's title here
117+
## Put Level's title here
118118
119119
> Level's summary: a short description of the level's content in one line.
120120
@@ -126,7 +126,7 @@ Some text that describes the level
126126
Should not be an issue
127127
\`\`\`
128128
129-
###L1S1
129+
###Step 1
130130
131131
First Step`;
132132
expect(validateMarkdown(md)).toBe(true);

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp