setup-php/node_modules/codecov/test/services/cirrus.test.js

28 lines
776 B
JavaScript
Raw Normal View History

2019-09-20 09:41:20 +07:00
var cirrus = require('../../lib/services/cirrus')
describe('Cirrus CI Provider', function() {
it('can detect cirrus', function() {
process.env.CIRRUS_CI = 'true'
expect(cirrus.detect()).toBe(true)
})
it('can get cirrus env info', function() {
process.env.CIRRUS_CI = 'true'
process.env.CIRRUS_BUILD_ID = '1234.1'
process.env.CIRRUS_CHANGE_IN_REPO = '5678'
process.env.CIRRUS_BRANCH = 'master'
process.env.CIRRUS_TASK_ID = '1234.1'
process.env.CIRRUS_PR = 'blah'
process.env.CIRRUS_REPO_FULL_NAME = 'owner/repo'
expect(cirrus.configuration()).toEqual({
service: 'cirrusci',
commit: '5678',
build: '1234.1',
job: '1234.1',
branch: 'master',
pr: 'blah',
slug: 'owner/repo',
})
})
})