This repository has been archived by the owner on Jan 10, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 112
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
b811a12
commit 25a4e6b
Showing
3 changed files
with
39 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
// https://devcenter.heroku.com/articles/heroku-ci | ||
|
||
module.exports = { | ||
detect: function() { | ||
return !!process.env.HEROKU_TEST_RUN_ID | ||
}, | ||
|
||
configuration: function() { | ||
console.log(' heroku CI Detected') | ||
return { | ||
service: 'heroku', | ||
build: process.env.HEROKU_TEST_RUN_ID, | ||
commit: process.env.HEROKU_TEST_RUN_COMMIT_VERSION, | ||
branch: process.env.HEROKU_TEST_RUN_BRANCH, | ||
} | ||
}, | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
var heroku = require('../../lib/services/heroku') | ||
|
||
describe('Heroku CI Provider', function() { | ||
it('can detect heroku', function() { | ||
process.env.HEROKU_TEST_RUN_ID = '454f5dc9-afa4-433f-bb28-84678a00fd98' | ||
expect(heroku.detect()).toBe(true) | ||
}) | ||
|
||
it('can get wercker env info', function() { | ||
process.env.HEROKU_TEST_RUN_ID = '454f5dc9-afa4-433f-bb28-84678a00fd98' | ||
process.env.HEROKU_TEST_RUN_COMMIT_VERSION = | ||
'743b04806ea677403aa2ff26c6bdeb85005de658' | ||
process.env.HEROKU_TEST_RUN_BRANCH = 'master' | ||
expect(heroku.configuration()).toEqual({ | ||
service: 'heroku', | ||
commit: '743b04806ea677403aa2ff26c6bdeb85005de658', | ||
build: '454f5dc9-afa4-433f-bb28-84678a00fd98', | ||
branch: 'master', | ||
}) | ||
}) | ||
}) |