Skip to content

Commit

Permalink
chore: Test getRefContext
Browse files Browse the repository at this point in the history
  • Loading branch information
franky47 committed Mar 9, 2021
1 parent 313c883 commit 121e493
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 37 deletions.
22 changes: 22 additions & 0 deletions __tests__/gha.test.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
import { getRefContext } from '../src/gha'

test('getRefContext - branch', () => {
expect(getRefContext('refs/heads/foo')).toEqual('branch *foo*')
expect(getRefContext('refs/heads/foo/bar/egg')).toEqual(
'branch *foo/bar/egg*'
)
expect(getRefContext('refs/heads/foo.bar-egg')).toEqual(
'branch *foo.bar-egg*'
)
})

test('getRefContext - tag', () => {
expect(getRefContext('refs/tags/1.2.3')).toEqual('tag *1.2.3*')
expect(getRefContext('refs/tags/1.2.3-beta_off-12')).toEqual(
'tag *1.2.3-beta_off-12*'
)
})

test('getRefContext - PR', () => {
expect(getRefContext('refs/pull/123/merge')).toEqual('PR *#123*')
})
28 changes: 0 additions & 28 deletions __tests__/main.test.ts

This file was deleted.

9 changes: 0 additions & 9 deletions src/wait.ts

This file was deleted.

0 comments on commit 121e493

Please sign in to comment.