Skip to content
This repository has been archived by the owner on Jan 10, 2023. It is now read-only.

Commit

Permalink
Fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
thomasrockhu committed Sep 16, 2020
1 parent f033b57 commit 02c9014
Showing 1 changed file with 23 additions and 4 deletions.
27 changes: 23 additions & 4 deletions test/services/github_actions.test.js
Expand Up @@ -6,15 +6,34 @@ describe('GitHub Actions CI Provider', function() {
expect(github_actions.detect()).toBe(true)
})

it('can get GitHub Actions env info', function() {
process.env.GITHUB_SHA = '743b04806ea677403aa2ff26c6bdeb85005de658'
process.env.GITHUB_REPOSITORY = 'codecov/codecov-repo'
it('can get GitHub Actions env info on push event', function() {
process.env.GITHUB_REF = 'refs/heads/master'
process.env.GITHUB_REPOSITORY = 'codecov/codecov-repo'
process.env.GITHUB_RUN_ID = '257701960'
process.env.GITHUB_SHA = '743b04806ea677403aa2ff26c6bdeb85005de658'

expect(github_actions.configuration()).toEqual({
branch: 'master',
build: '257701960',
commit: '743b04806ea677403aa2ff26c6bdeb85005de658',
service: 'github-actions',
slug: 'codecov/codecov-repo',
})
})

it('can get GitHub Actions env info on pull request', function() {
process.env.GITHUB_HEAD_REF = 'develop'
process.env.GITHUB_REF = 'refs/pull/7/merge'
process.env.GITHUB_REPOSITORY = 'codecov/codecov-repo'
process.env.GITHUB_RUN_ID = '257701960'
process.env.GITHUB_SHA = '743b04806ea677403aa2ff26c6bdeb85005de658'

expect(github_actions.configuration()).toEqual({
branch: 'develop',
build: '257701960',
commit: '743b04806ea677403aa2ff26c6bdeb85005de658',
branch: 'master',
pr: '7',
service: 'github-actions',
slug: 'codecov/codecov-repo',
})
})
Expand Down

0 comments on commit 02c9014

Please sign in to comment.