Improve code quality and write tests

This commit is contained in:
Shivam Mathur
2019-09-20 21:54:46 +05:30
parent db44db4b97
commit 43178a7254
3597 changed files with 255478 additions and 785554 deletions
+20
View File
@@ -0,0 +1,20 @@
var git = require('../lib/git')
var execSync = require('child_process').execSync
describe('Git', function() {
it('can get the branch', function() {
expect(git.branch()).toEqual(
execSync('git rev-parse --abbrev-ref HEAD || hg branch')
.toString()
.trim()
)
})
it('can get the head', function() {
expect(git.head()).toEqual(
execSync("git log -1 --pretty=%H || hg id -i --debug | tr -d '+'")
.toString()
.trim()
)
})
})