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

Fix/id order#52

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
ShMcK merged 3 commits intomasterfromfix/id-order
Jun 25, 2020
Merged
Changes from1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
PrevPrevious commit
NextNext commit
add out of order id test
Signed-off-by: shmck <shawn.j.mckay@gmail.com>
  • Loading branch information
@ShMcK
ShMcK committedJun 25, 2020
commit14418938307450c263be482ade312cc56ff920fe
102 changes: 102 additions & 0 deletionstests/parse.test.ts
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -837,6 +837,108 @@ The first step
});
});

it("should load when commits are not in direct order (100, 200, 201)", () => {
const md = `# Title

Description.

## 100. Title

First line

### 100.1

The first step

## 200. Title

First line

### 200.1

The first step

## 201. Title

First line

### 201.1

The first step
`;
const skeleton = {
levels: [
{
id: "100",
steps: [{ id: "100.1" }],
},
{
id: "200",
steps: [{ id: "200.1" }],
},
{
id: "201",
steps: [{ id: "201.1" }],
},
],
};
const result = parse({
text: md,
skeleton,
commits: {},
});
const expected = {
summary: {
description: "Description.",
},
levels: [
{
id: "100",
summary: "First line",
content: "First line",
steps: [
{
id: "100.1",
content: "The first step",
setup: {
commits: [],
},
},
],
},
{
id: "200",
summary: "Second line",
content: "Second line",
steps: [
{
id: "200.1",
content: "The second step",
setup: {
commits: [],
},
},
],
},
{
id: "201",
summary: "Third line",
content: "Third line",
steps: [
{
id: "201.1",
content: "The third step",
setup: {
commits: [],
},
},
],
},
],
};
expect(result.levels).toEqual(expected.levels);
});

describe("config", () => {
it("should parse the tutorial config", () => {
const md = `# Title
Expand Down

[8]ページ先頭

©2009-2025 Movatter.jp