Skip to content

Commit f30b6ec

Browse files
committed
fix(Changelogs): add edge test case
1 parent 8674727 commit f30b6ec

File tree

2 files changed

+33
-0
lines changed

2 files changed

+33
-0
lines changed

test/changelog.test.ts

+23
Original file line numberDiff line numberDiff line change
@@ -133,4 +133,27 @@ After changelog
133133

134134
expect(changelogs.length).toBe(3);
135135
});
136+
137+
test('Should cut changelog on the edge and write it in variable', async () => {
138+
expect.assertions(2);
139+
140+
const data = (
141+
await fs.promises.readFile(
142+
path.join(__dirname, 'data/changelog/changelog_edge.md'),
143+
'utf8',
144+
)
145+
).trim();
146+
147+
const changelogs: ChangelogItem[] = [];
148+
const html = changelogCollect(data, {
149+
path: '',
150+
changelogs,
151+
log: console as unknown as Logger,
152+
extractChangelogs: true,
153+
});
154+
155+
expect(html).toBe('');
156+
157+
expect(changelogs.length).toBe(1);
158+
});
136159
});

test/data/changelog/changelog_edge.md

+10
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
{% changelog %}
2+
```
3+
storyId: 123321
4+
```
5+
# Change log title
6+
![My image](../src/asd.png =16x9)
7+
8+
Change log payload
9+
10+
{% endchangelog %}

0 commit comments

Comments
 (0)