Skip to content

Commit

Permalink
fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
kilokang committed Apr 3, 2024
1 parent cbf6778 commit ed58bb2
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 7 deletions.
1 change: 1 addition & 0 deletions .github/workflows/push_pr.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ jobs:
name: Run tests
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Check if CHANGELOG is valid
uses: ./validate-markdown

Expand Down
14 changes: 7 additions & 7 deletions src/changelog/linker/mapper/leadingv_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ func TestLeadingVCheck_Map(t *testing.T) {
name: "Check passed with leading v",
wrapped: &mapperMock{link: "link"},
dep: changelog.Dependency{To: semver.MustParse("v1.2.3")},
checkLink: func(link string) (bool, error) {
checkLink: func(_ string) (bool, error) {
return link == "link-v1.2.3", nil

Check failure on line 52 in src/changelog/linker/mapper/leadingv_test.go

View workflow job for this annotation

GitHub Actions / Run tests

undefined: link

Check failure on line 52 in src/changelog/linker/mapper/leadingv_test.go

View workflow job for this annotation

GitHub Actions / Static analysis and linting

undefined: link

Check failure on line 52 in src/changelog/linker/mapper/leadingv_test.go

View workflow job for this annotation

GitHub Actions / Static analysis and linting

undefined: link
},
expected: "link-v1.2.3",
Expand All @@ -58,7 +58,7 @@ func TestLeadingVCheck_Map(t *testing.T) {
name: "Check passed without leading v",
wrapped: &mapperMock{link: "link"},
dep: changelog.Dependency{To: semver.MustParse("1.2.3")},
checkLink: func(link string) (bool, error) {
checkLink: func(_ string) (bool, error) {
return link == "link-1.2.3", nil

Check failure on line 62 in src/changelog/linker/mapper/leadingv_test.go

View workflow job for this annotation

GitHub Actions / Run tests

undefined: link

Check failure on line 62 in src/changelog/linker/mapper/leadingv_test.go

View workflow job for this annotation

GitHub Actions / Static analysis and linting

undefined: link

Check failure on line 62 in src/changelog/linker/mapper/leadingv_test.go

View workflow job for this annotation

GitHub Actions / Static analysis and linting

undefined: link
},
expected: "link-1.2.3",
Expand All @@ -68,7 +68,7 @@ func TestLeadingVCheck_Map(t *testing.T) {
name: "Needs prepending v to pass the check",
wrapped: &mapperMock{link: "link"},
dep: changelog.Dependency{To: semver.MustParse("1.2.3")},
checkLink: func(link string) (bool, error) {
checkLink: func(_ string) (bool, error) {
return link == "link-v1.2.3", nil

Check failure on line 72 in src/changelog/linker/mapper/leadingv_test.go

View workflow job for this annotation

GitHub Actions / Run tests

undefined: link

Check failure on line 72 in src/changelog/linker/mapper/leadingv_test.go

View workflow job for this annotation

GitHub Actions / Static analysis and linting

undefined: link

Check failure on line 72 in src/changelog/linker/mapper/leadingv_test.go

View workflow job for this annotation

GitHub Actions / Static analysis and linting

undefined: link
},
expected: "link-v1.2.3",
Expand All @@ -78,7 +78,7 @@ func TestLeadingVCheck_Map(t *testing.T) {
name: "Needs removing v to pass the check",
wrapped: &mapperMock{link: "link"},
dep: changelog.Dependency{To: semver.MustParse("v1.2.3")},
checkLink: func(link string) (bool, error) {
checkLink: func(_ string) (bool, error) {
return link == "link-1.2.3", nil

Check failure on line 82 in src/changelog/linker/mapper/leadingv_test.go

View workflow job for this annotation

GitHub Actions / Run tests

undefined: link

Check failure on line 82 in src/changelog/linker/mapper/leadingv_test.go

View workflow job for this annotation

GitHub Actions / Static analysis and linting

undefined: link (typecheck)

Check failure on line 82 in src/changelog/linker/mapper/leadingv_test.go

View workflow job for this annotation

GitHub Actions / Static analysis and linting

undefined: link) (typecheck)
},
expected: "link-1.2.3",
Expand All @@ -88,7 +88,7 @@ func TestLeadingVCheck_Map(t *testing.T) {
name: "Check will not pass even prepending v",
wrapped: &mapperMock{link: "link"},
dep: changelog.Dependency{To: semver.MustParse("1.2.3")},
checkLink: func(link string) (bool, error) {
checkLink: func(_ string) (bool, error) {
return false, nil
},
expected: "",
Expand All @@ -98,7 +98,7 @@ func TestLeadingVCheck_Map(t *testing.T) {
name: "Check will not pass even removing v",
wrapped: &mapperMock{link: "link"},
dep: changelog.Dependency{To: semver.MustParse("v1.2.3")},
checkLink: func(link string) (bool, error) {
checkLink: func(_ string) (bool, error) {
return false, nil
},
expected: "",
Expand All @@ -108,7 +108,7 @@ func TestLeadingVCheck_Map(t *testing.T) {
name: "Check returns an error",
wrapped: &mapperMock{link: "link"},
dep: changelog.Dependency{To: semver.MustParse("1.2.3")},
checkLink: func(link string) (bool, error) {
checkLink: func(_ string) (bool, error) {
return false, errors.New("")
},
expected: "link-1.2.3", // It uses the link from the underlying mapper.
Expand Down

0 comments on commit ed58bb2

Please sign in to comment.