Skip to content

Commit

Permalink
chore: conditionally skip certain test for foked prs
Browse files Browse the repository at this point in the history
  • Loading branch information
jackton1 committed Aug 21, 2024
1 parent 525aabb commit 28c0f8a
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions src/__tests__/utils.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -659,8 +659,11 @@ describe('utils test', () => {
})
})
describe('getPreviousGitTag', () => {
// 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
it('should return the second latest tag and its SHA when multiple tags are present', async () => {
(shouldSkip ? test.skip : test)('should return the second latest tag and its SHA when multiple tags are present', async () => {

Check failure on line 666 in src/__tests__/utils.test.ts

View workflow job for this annotation

GitHub Actions / build

This expression is not callable.
const result = await getPreviousGitTag({
cwd: '.',
tagsPattern: '*',
Expand All @@ -674,7 +677,7 @@ describe('utils test', () => {
})

// Tags are filtered by a specified pattern when 'tagsPattern' is provided
it('should filter tags by the specified pattern', async () => {
(shouldSkip ? test.skip : test)('should filter tags by the specified pattern', async () => {
const result = await getPreviousGitTag({
cwd: '.',
tagsPattern: 'v1.*',
Expand All @@ -688,7 +691,7 @@ describe('utils test', () => {
})

// Tags are excluded by a specified ignore pattern when 'tagsIgnorePattern' is provided
it('should exclude tags by the specified ignore pattern', async () => {
(shouldSkip ? test.skip : test)('should exclude tags by the specified ignore pattern', async () => {
const result = await getPreviousGitTag({
cwd: '.',
tagsPattern: '*',
Expand Down

0 comments on commit 28c0f8a

Please sign in to comment.