1 | var git = require('../lib/git')
|
2 | var execSync = require('child_process').execSync
|
3 |
|
4 | describe('Git', function() {
|
5 | it('can get the branch', function() {
|
6 | expect(git.branch()).toEqual(
|
7 | execSync('git rev-parse --abbrev-ref HEAD || hg branch')
|
8 | .toString()
|
9 | .trim()
|
10 | )
|
11 | })
|
12 |
|
13 | it('can get the head', function() {
|
14 | expect(git.head()).toEqual(
|
15 | execSync("git log -1 --pretty=%H || hg id -i --debug | tr -d '+'")
|
16 | .toString()
|
17 | .trim()
|
18 | )
|
19 | })
|
20 | })
|