Code coverage report for ggit/test/blame.js

Statements: 81.25% (13 / 16)      Branches: 50% (2 / 4)      Functions: 75% (3 / 4)      Lines: 81.25% (13 / 16)      Ignored: none     

All files » ggit/test/ » blame.js
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 241 1 1   1   1 1 1   1 1 1 1 1           1      
var blame = require('../index').blame;
require('lazy-ass');
var check = require('check-types');
 
gt.module('blame');
 
gt.async('blame for this file', function () {
  var p = blame(__filename, 1);
  la(check.object(p) && check.fn(p.then),
    'returns a promise', p);
  p.then(function (info) {
    la(check.object(info), 'got blame', info);
    console.log(info);
    la(check.unemptyString(info.author), 'has author');
    la(check.unemptyString(info.line), 'has line');
  }, function onError(err) {
    console.error(err);
    la(check.unemptyString(err) || check.unemptyString(err.message), 'error is a message');
    gt.ok(false, err);
  }).finally(function () {
    gt.start();
  }).done();
});