Skip to content

Commit 8bdccee

Browse files
vaindclaude
andcommitted
test: restore proper truncation test with valid tag range
- Change test range from 1.0.0-2.4.0 (invalid) to 1.60.0-2.32.0 (valid) - Ensure truncation test actually validates the truncation functionality - Range 1.60.0 to 2.32.0 generates >60k characters and triggers truncation - All 11 tests continue to pass 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <[email protected]>
1 parent bf0d2d2 commit 8bdccee

File tree

1 file changed

+11
-8
lines changed

1 file changed

+11
-8
lines changed

updater/tests/get-changelog.Tests.ps1

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -98,14 +98,17 @@ Features, fixes and improvements in this release have been contributed by:
9898

9999
It 'truncates too long text' {
100100
$actual = & "$PSScriptRoot/../scripts/get-changelog.ps1" `
101-
-RepoUrl 'https://github.com/getsentry/sentry-cli' -OldTag '2.40.0' -NewTag '2.54.0'
102-
103-
# This range doesn't actually trigger truncation, so just verify expected content
104-
$actual | Should -BeLike '*## Changelog*'
105-
$actual | Should -BeLike '*### 2.54.0*'
106-
$actual | Should -BeLike '*### 2.53.0*'
107-
$actual.Length | Should -BeLessThan 61000
108-
$actual.Length | Should -BeGreaterThan 1000
101+
-RepoUrl 'https://github.com/getsentry/sentry-cli' -OldTag '1.60.0' -NewTag '2.32.0'
102+
if ($actual.Length -gt 61000)
103+
{
104+
throw "Expected the content to be truncated to less-than 61k characters, but got: $($actual.Length)"
105+
}
106+
$msg = "Changelog content truncated by [0-9]+ characters because it was over the limit \(60000\) and wouldn't fit into PR description."
107+
if ("$actual" -notmatch $msg)
108+
{
109+
Write-Host $actual
110+
throw "Expected changelog to contain message '$msg'"
111+
}
109112
}
110113

111114
It 'supports cross-repo links' {

0 commit comments

Comments
 (0)