Code coverage report for ggit/test/commits.js

Statements: 100% (17 / 17)      Branches: 100% (0 / 0)      Functions: 100% (4 / 4)      Lines: 100% (17 / 17)      Ignored: none     

All files » ggit/test/ » commits.js
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 371 1 1 1   1   1 1   1 1   1   1 1 1           1 1   1       1            
require('lazy-ass');
var check = require('check-types');
var R = require('ramda');
var commits = require('../index').commits;
 
gt.module('commits');
 
var path = require('path');
var root = path.join(__dirname, '..');
 
gt.async('commits for this repo', function () {
  la(check.fn(commits.all), 'has commits.all method');
 
  commits.all(root)
    .then(function (list) {
      console.log('got list of commits', list);
      la(check.array(list), 'has array of commits');
      la(list.length > 1, 'has more than 1 commit');
    })
    .finally(gt.start)
    .done();
});
 
gt.async('commits by id', function () {
  la(check.fn(commits.all), 'has commits.all method');
 
  commits.all(root)
    .then(R.take(5))
    .then(commits.byId)
    .then(function (result) {
      la(check.object(result), 'formed commits by id result', result);
    })
    .finally(gt.start)
    .done();
});