Skip to content

Conversation

jackton1
Copy link
Contributor

No description provided.

cursor[bot]

This comment was marked as outdated.

@jackton1 jackton1 enabled auto-merge (squash) June 15, 2025 08:03
Copy link

@cursor cursor bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Bug: Mocked Tests Incorrectly Skipped

The shouldSkip condition is incorrectly applied to tests within the getPreviousGitTag suite that mock exec.getExecOutput. As these tests do not depend on actual Git repository state, skipping them is unnecessary and reduces test coverage. This also creates an inconsistency with other similar mocked tests in the same suite that correctly lack the shouldSkip condition.

src/__tests__/utils.test.ts#L730-L753

it('should return empty values when only one tag is available', async () => {
if (shouldSkip) {
return
}
jest.spyOn(exec, 'getExecOutput').mockResolvedValueOnce({
stdout:
'v1.0.1|f0751de6af436d4e79016e2041cf6400e0833653|2021-01-01T00:00:00Z',
stderr: '',
exitCode: 0
})
const result = await getPreviousGitTag({
cwd: '.',
tagsPattern: '*',
tagsIgnorePattern: '',
currentBranch: 'v1.0.1'
})
expect(result).toEqual({tag: '', sha: ''})
})
// Git commands fail and throw errors
it('should throw an error when git commands fail', async () => {
if (shouldSkip) {
return
}

Fix in Cursor


Was this report helpful? Give feedback by reacting with 👍 or 👎

@jackton1 jackton1 closed this Jun 15, 2025
auto-merge was automatically disabled June 15, 2025 08:07

Pull request was closed

@jackton1 jackton1 deleted the chore/update-test branch July 14, 2025 04:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant