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

18 lines
525 B
JavaScript
Raw Normal View History

2019-09-20 09:41:20 +07:00
var local = require('../../lib/services/localGit')
var execSync = require('child_process').execSync
describe('Local git/mercurial CI Provider', function() {
it('can get commit', function() {
expect(local.configuration().commit).toMatch(/^\w{40}$/)
expect(local.configuration().commit).toEqual(
execSync("git rev-parse HEAD || hg id -i --debug | tr -d '+'")
.toString()
.trim()
)
})
it('can get branch', function() {
expect(local.configuration().branch).not.toEqual(null)
})
})