UNPKG

525 BJavaScriptView Raw
1var local = require('../../lib/services/localGit')
2var execSync = require('child_process').execSync
3
4describe('Local git/mercurial CI Provider', function() {
5 it('can get commit', function() {
6 expect(local.configuration().commit).toMatch(/^\w{40}$/)
7 expect(local.configuration().commit).toEqual(
8 execSync("git rev-parse HEAD || hg id -i --debug | tr -d '+'")
9 .toString()
10 .trim()
11 )
12 })
13
14 it('can get branch', function() {
15 expect(local.configuration().branch).not.toEqual(null)
16 })
17})