Skip to content

Commit

Permalink
Update the test
Browse files Browse the repository at this point in the history
  • Loading branch information
jackton1 committed Aug 21, 2024
1 parent 9612fa1 commit 0cb5352
Showing 1 changed file with 18 additions and 14 deletions.
32 changes: 18 additions & 14 deletions src/__tests__/utils.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -662,24 +662,26 @@ describe('utils test', () => {
// Check if the environment variable GITHUB_REPOSITORY_OWNER is 'tj-actions'
const shouldSkip = process.env.GITHUB_REPOSITORY_OWNER !== 'tj-actions'
// Function returns the second-latest tag and its SHA
;(shouldSkip ? test.skip : test)(
'should return the second latest tag and its SHA when multiple tags are present',
async () => {
const result = await getPreviousGitTag({
cwd: '.',
tagsPattern: '*',
it('should return the second latest tag and its SHA when multiple tags are present', async () => {
if (shouldSkip) {
return
}
const result = await getPreviousGitTag({
cwd: '.',
tagsPattern: '*',
tagsIgnorePattern: '',
currentBranch: 'v1.0.1'
})
expect(result).toEqual({
tag: 'v1.0.0',
sha: 'f0751de6af436d4e79016e2041cf6400e0833653'
})
})
// Tags are filtered by a specified pattern when 'tagsPattern' is provided
it('should filter tags by the specified pattern', async () => {
if (shouldSkip) {
return
}
)(
// Tags are filtered by a specified pattern when 'tagsPattern' is provided
shouldSkip ? test.skip : test
)('should filter tags by the specified pattern', async () => {
const result = await getPreviousGitTag({
cwd: '.',
tagsPattern: 'v1.*',
Expand All @@ -690,10 +692,12 @@ describe('utils test', () => {
tag: 'v1.0.0',
sha: 'f0751de6af436d4e79016e2041cf6400e0833653'
})
})(
// Tags are excluded by a specified ignore pattern when 'tagsIgnorePattern' is provided
shouldSkip ? test.skip : test
)('should exclude tags by the specified ignore pattern', async () => {
})
// Tags are excluded by a specified ignore pattern when 'tagsIgnorePattern' is provided
it('should exclude tags by the specified ignore pattern', async () => {
if (shouldSkip) {
return
}
const result = await getPreviousGitTag({
cwd: '.',
tagsPattern: '*',
Expand Down

0 comments on commit 0cb5352

Please sign in to comment.