Skip to content

Commit

Permalink
Add HTML characters to test data
Browse files Browse the repository at this point in the history
  • Loading branch information
cookpete committed Sep 4, 2019
1 parent 575dcc9 commit b4eb7d7
Show file tree
Hide file tree
Showing 10 changed files with 16 additions and 14 deletions.
4 changes: 3 additions & 1 deletion scripts/generate-test-data.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,14 +27,16 @@ async function writeTemplate (filename, template, releases) {
async function run () {
const gitLog = await readFile(join(DATA_DIR, 'git-log.txt'))
const commits = parseCommits(gitLog, remotes.github, options)
const commitsNoRemote = parseCommits(gitLog, remotes.null, options)
const releases = parseReleases(commits, remotes.github, null, options)
const commitsNoRemote = parseCommits(gitLog, remotes.null, options)
const releasesNoRemote = parseReleases(commitsNoRemote, remotes.null, null, options)
await writeObject('commits.js', commits)
await writeObject('commits-no-remote.js', commitsNoRemote)
await writeObject('releases.js', releases)
await writeTemplate('template-compact.md', 'compact', releases)
await writeTemplate('template-keepachangelog.md', 'keepachangelog', releases)
await writeTemplate('template-json.json', 'json', releases)
await writeTemplate('template-compact-no-remote.md', 'compact', releasesNoRemote)
}

run().catch(e => console.error(e))
4 changes: 2 additions & 2 deletions test/data/commits-no-remote.js
Original file line number Diff line number Diff line change
Expand Up @@ -97,8 +97,8 @@ export default [
"email": "[email protected]",
"date": "2015-12-29T21:18:19.000Z",
"tag": null,
"subject": "Commit that fixes nothing with `backticks`",
"message": "Commit that fixes nothing with `backticks`",
"subject": "Commit that fixes nothing with `backticks` and <html>",
"message": "Commit that fixes nothing with `backticks` and <html>",
"fixes": null,
"href": null,
"breaking": false,
Expand Down
4 changes: 2 additions & 2 deletions test/data/commits.js
Original file line number Diff line number Diff line change
Expand Up @@ -97,8 +97,8 @@ export default [
"email": "[email protected]",
"date": "2015-12-29T21:18:19.000Z",
"tag": null,
"subject": "Commit that fixes nothing with `backticks`",
"message": "Commit that fixes nothing with `backticks`",
"subject": "Commit that fixes nothing with `backticks` and <html>",
"message": "Commit that fixes nothing with `backticks` and <html>",
"fixes": null,
"href": "https://github.com/user/repo/commit/12c0624e7e419a70bd5f3b403d7e0bd8f23ec617",
"breaking": false,
Expand Down
2 changes: 1 addition & 1 deletion test/data/git-log.txt
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ __AUTO_CHANGELOG_MESSAGE_SEPARATOR__
2015-12-29 21:18:19 +0000
Pete Cook
[email protected]
Commit that fixes nothing with `backticks`
Commit that fixes nothing with `backticks` and <html>
__AUTO_CHANGELOG_MESSAGE_SEPARATOR__
1 files changed, 2 insertions(+), 3 deletions(-)

Expand Down
4 changes: 2 additions & 2 deletions test/data/releases.js
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,8 @@ export default [
"email": "[email protected]",
"date": "2015-12-29T21:18:19.000Z",
"tag": null,
"subject": "Commit that fixes nothing with `backticks`",
"message": "Commit that fixes nothing with `backticks`",
"subject": "Commit that fixes nothing with `backticks` and &lt;html&gt;",
"message": "Commit that fixes nothing with `backticks` and &lt;html&gt;",
"fixes": null,
"href": "https://github.com/user/repo/commit/12c0624e7e419a70bd5f3b403d7e0bd8f23ec617",
"breaking": false,
Expand Down
2 changes: 1 addition & 1 deletion test/data/template-compact-no-remote.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).

> 29 December 2015
- Commit that fixes nothing with `backticks`
- Commit that fixes nothing with `backticks` and &lt;html&gt;
- Another commit that fixes nothing but with less changes

#### v0.0.2
Expand Down
2 changes: 1 addition & 1 deletion test/data/template-compact.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).

> 29 December 2015
- Commit that fixes nothing with `backticks` [`12c0624`](https://github.com/user/repo/commit/12c0624e7e419a70bd5f3b403d7e0bd8f23ec617)
- Commit that fixes nothing with `backticks` and &lt;html&gt; [`12c0624`](https://github.com/user/repo/commit/12c0624e7e419a70bd5f3b403d7e0bd8f23ec617)
- Another commit that fixes nothing but with less changes [`e9a43b2`](https://github.com/user/repo/commit/e9a43b2bf50449fc0d84465308e6008cc1597bb3)

#### [v0.0.2](https://github.com/user/repo/compare/v0.0.1...v0.0.2)
Expand Down
4 changes: 2 additions & 2 deletions test/data/template-json.json
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,8 @@
"email": "[email protected]",
"date": "2015-12-29T21:18:19.000Z",
"tag": null,
"subject": "Commit that fixes nothing with `backticks`",
"message": "Commit that fixes nothing with `backticks`",
"subject": "Commit that fixes nothing with `backticks` and &lt;html&gt;",
"message": "Commit that fixes nothing with `backticks` and &lt;html&gt;",
"fixes": null,
"href": "https://github.com/user/repo/commit/12c0624e7e419a70bd5f3b403d7e0bd8f23ec617",
"breaking": false,
Expand Down
2 changes: 1 addition & 1 deletion test/data/template-keepachangelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).

### Commits

- Commit that fixes nothing with `backticks` [`12c0624`](https://github.com/user/repo/commit/12c0624e7e419a70bd5f3b403d7e0bd8f23ec617)
- Commit that fixes nothing with `backticks` and &lt;html&gt; [`12c0624`](https://github.com/user/repo/commit/12c0624e7e419a70bd5f3b403d7e0bd8f23ec617)
- Another commit that fixes nothing but with less changes [`e9a43b2`](https://github.com/user/repo/commit/e9a43b2bf50449fc0d84465308e6008cc1597bb3)

## [v0.0.2](https://github.com/user/repo/compare/v0.0.1...v0.0.2) - 2015-12-28
Expand Down
2 changes: 1 addition & 1 deletion test/matches-helper.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ describe('matches helper', () => {
'- {{{message}}}\n' +
'{{/matches}}\n'
const expected =
'- Commit that fixes nothing with `backticks`\n'
'- Commit that fixes nothing with `backticks` and &lt;html&gt;\n'
expect(compileCommits(matches)({ releases })).to.equal(expected)
})

Expand Down

0 comments on commit b4eb7d7

Please sign in to comment.