{"size": 951, "ext": "js", "max_stars_repo_path": "test/linkToCommit_test.js", "max_stars_repo_name": "GerHobbelt/lorax", "max_stars_repo_stars_event_min_datetime": null, "max_stars_repo_stars_event_max_datetime": null, "max_issues_repo_path": "test/linkToCommit_test.js", "max_issues_repo_name": "GerHobbelt/lorax", "max_issues_repo_issues_event_min_datetime": null, "max_issues_repo_issues_event_max_datetime": null, "max_forks_repo_path": "test/linkToCommit_test.js", "max_forks_repo_name": "GerHobbelt/lorax", "max_forks_repo_forks_event_min_datetime": null, "max_forks_repo_forks_event_max_datetime": null}
{"max_stars_count": null, "max_issues_count": null, "max_forks_count": null, "avg_line_length": 22.6428571429, "max_line_length": 68, "alphanum_fraction": 0.6256572029}
'use strict';

const test = require('ava');
const {Printer} = require('../build/lib/printer');
const {Config} = require('../build/lib/config');

test.beforeEach((t) => {
  t.context.config = new Config();
  t.context.printer = new Printer([], 'v0.1.0', t.context.config);
});

test.afterEach((t) => {
  t.context = {};
});

test('basicTest', (t) => {
  const output = t.context.printer.linkToCommit('1a91039');
  t.is(
    output,
    '[1a91039](https://github.com/adrianlee44/lorax/commit/1a91039)'
  );
});

test('noUrlTest', (t) => {
  t.context.config.set('url', '');

  const output = t.context.printer.linkToCommit('1a91031a9849');
  t.is(output, '1a91031a');
});

test('noCommitTemplateTest', (t) => {
  t.context.config.set('commit', '');

  const output = t.context.printer.linkToCommit('1a91031a9849');
  t.is(output, '1a91031a');
});

test('noCommitTest', (t) => {
  const output = t.context.printer.linkToCommit();
  t.is(output, '');
});
