Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
changelog-generator-default
Manage
Activity
Members
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Package registry
Model registry
Operate
Terraform modules
Analyze
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
GitHub Mirror
go-semantic-release
changelog-generator-default
Commits
b76f53a5
Commit
b76f53a5
authored
4 years ago
by
timoknapp
Committed by
Christoph Witzko
4 years ago
Browse files
Options
Downloads
Patches
Plain Diff
test: add test for 'prettified_output' config
parent
399e0b45
No related branches found
No related tags found
No related merge requests found
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
examples/GENERATED_CHANGELOG copy.md
+0
-33
0 additions, 33 deletions
examples/GENERATED_CHANGELOG copy.md
pkg/generator/changelog_generator_test.go
+31
-0
31 additions, 0 deletions
pkg/generator/changelog_generator_test.go
with
31 additions
and
33 deletions
examples/GENERATED_CHANGELOG copy.md
deleted
100644 → 0
+
0
−
33
View file @
399e0b45
## 2.0.0 (2020-11-11)
#### Breaking Changes
*
commit message (12345678)
```
BREAKING CHANGE: test
```
*
**user:**
another commit message (12345679)
```
changed ID int into UUID
```
#### Feature
*
**app:**
commit message (12345678)
#### Bug Fixes
*
commit message (abcd)
#### Build
*
commit message (43218765)
#### CI
*
commit message (87654321)
#### yolo
*
**swag:**
commit message (12345678)
This diff is collapsed.
Click to expand it.
pkg/generator/changelog_generator_test.go
+
31
−
0
View file @
b76f53a5
...
...
@@ -35,3 +35,34 @@ func TestDefaultGenerator(t *testing.T) {
t
.
Fail
()
}
}
func
TestPrettifiedGenerator
(
t
*
testing
.
T
)
{
changelogConfig
:=
&
generator
.
ChangelogGeneratorConfig
{}
changelogConfig
.
Commits
=
[]
*
semrel
.
Commit
{
{},
{
SHA
:
"123456789"
,
Type
:
"feat"
,
Scope
:
"app"
,
Message
:
"commit message"
},
{
SHA
:
"abcd"
,
Type
:
"fix"
,
Scope
:
""
,
Message
:
"commit message"
},
{
SHA
:
"87654321"
,
Type
:
"ci"
,
Scope
:
""
,
Message
:
"commit message"
},
{
SHA
:
"43218765"
,
Type
:
"build"
,
Scope
:
""
,
Message
:
"commit message"
},
{
SHA
:
"12345678"
,
Type
:
"yolo"
,
Scope
:
"swag"
,
Message
:
"commit message"
},
{
SHA
:
"12345678"
,
Type
:
"chore"
,
Scope
:
""
,
Message
:
"commit message"
,
Raw
:
[]
string
{
""
,
"BREAKING CHANGE: test"
},
Change
:
&
semrel
.
Change
{
Major
:
true
}},
{
SHA
:
"12345679"
,
Type
:
"chore!"
,
Scope
:
"user"
,
Message
:
"another commit message"
,
Raw
:
[]
string
{
"another commit message"
,
"changed ID int into UUID"
},
Change
:
&
semrel
.
Change
{
Major
:
true
}},
{
SHA
:
"stop"
,
Type
:
"chore"
,
Scope
:
""
,
Message
:
"not included"
},
}
changelogConfig
.
LatestRelease
=
&
semrel
.
Release
{
SHA
:
"stop"
}
changelogConfig
.
NewVersion
=
"2.0.0"
generator
:=
&
DefaultChangelogGenerator
{
prettifiedOutput
:
true
}
changelog
:=
generator
.
Generate
(
changelogConfig
)
if
!
strings
.
Contains
(
changelog
,
"* **app:** commit message (12345678)"
)
||
!
strings
.
Contains
(
changelog
,
"* commit message (abcd)"
)
||
!
strings
.
Contains
(
changelog
,
"#### 🎁 Feature"
)
||
!
strings
.
Contains
(
changelog
,
"#### 🐞 Bug Fixes"
)
||
!
strings
.
Contains
(
changelog
,
"#### 🔁 CI"
)
||
!
strings
.
Contains
(
changelog
,
"#### 📦 Build"
)
||
!
strings
.
Contains
(
changelog
,
"#### 📣 Breaking Changes"
)
||
!
strings
.
Contains
(
changelog
,
"#### yolo"
)
||
!
strings
.
Contains
(
changelog
,
"```
\n
BREAKING CHANGE: test
\n
```"
)
||
strings
.
Contains
(
changelog
,
"not included"
)
{
t
.
Fail
()
}
}
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment