fix: Make all contributors names bold (#55)

This commit is contained in:
Mehdi Achour 2017-11-02 17:52:39 +01:00 committed by Kent C. Dodds
parent 28eb16dea1
commit 07b3a684fc
2 changed files with 5 additions and 5 deletions

View file

@ -4,7 +4,7 @@ var _ = require('lodash/fp');
var formatContributionType = require('./format-contribution-type');
var avatarTemplate = _.template('<img src="<%= contributor.avatar_url %>" width="<%= options.imageSize %>px;"/>');
var avatarBlockTemplate = _.template('[<%= avatar %><br /><sub><%= name %></sub>](<%= contributor.profile %>)');
var avatarBlockTemplate = _.template('[<%= avatar %><br /><sub><b><%= name %></b></sub>](<%= contributor.profile %>)');
var contributorTemplate = _.template('<%= avatarBlock %><br /><%= contributions %>');
var defaultImageSize = 100;

View file

@ -16,7 +16,7 @@ test('should format a simple contributor', t => {
const contributor = _.assign(contributors.kentcdodds, {contributions: ['review']});
const {options} = fixtures();
const expected = '[<img src="https://avatars1.githubusercontent.com/u/1500684" width="150px;"/><br /><sub>Kent C. Dodds</sub>](http://kentcdodds.com)<br />[👀](#review-kentcdodds "Reviewed Pull Requests")';
const expected = '[<img src="https://avatars1.githubusercontent.com/u/1500684" width="150px;"/><br /><sub><b>Kent C. Dodds</b></sub>](http://kentcdodds.com)<br />[👀](#review-kentcdodds "Reviewed Pull Requests")';
t.is(formatContributor(options, contributor), expected);
});
@ -25,7 +25,7 @@ test('should format contributor with complex contribution types', t => {
const contributor = contributors.kentcdodds;
const {options} = fixtures();
const expected = '[<img src="https://avatars1.githubusercontent.com/u/1500684" width="150px;"/><br /><sub>Kent C. Dodds</sub>](http://kentcdodds.com)<br />[📖](https://github.com/jfmengels/all-contributors-cli/commits?author=kentcdodds "Documentation") [👀](#review-kentcdodds "Reviewed Pull Requests") [💬](#question-kentcdodds "Answering Questions")';
const expected = '[<img src="https://avatars1.githubusercontent.com/u/1500684" width="150px;"/><br /><sub><b>Kent C. Dodds</b></sub>](http://kentcdodds.com)<br />[📖](https://github.com/jfmengels/all-contributors-cli/commits?author=kentcdodds "Documentation") [👀](#review-kentcdodds "Reviewed Pull Requests") [💬](#question-kentcdodds "Answering Questions")';
t.is(formatContributor(options, contributor), expected);
});
@ -45,7 +45,7 @@ test('should default image size to 100', t => {
const {options} = fixtures();
delete options.imageSize;
const expected = '[<img src="https://avatars1.githubusercontent.com/u/1500684" width="100px;"/><br /><sub>Kent C. Dodds</sub>](http://kentcdodds.com)<br />[👀](#review-kentcdodds "Reviewed Pull Requests")';
const expected = '[<img src="https://avatars1.githubusercontent.com/u/1500684" width="100px;"/><br /><sub><b>Kent C. Dodds</b></sub>](http://kentcdodds.com)<br />[👀](#review-kentcdodds "Reviewed Pull Requests")';
t.is(formatContributor(options, contributor), expected);
});
@ -54,7 +54,7 @@ test('should format contributor with pipes in their name', t => {
const contributor = contributors.pipey;
const {options} = fixtures();
const expected = '[<img src="https://avatars1.githubusercontent.com/u/1500684" width="150px;"/><br /><sub>Who &#124; Needs &#124; Pipes?</sub>](http://github.com/chrisinajar)<br />[📖](https://github.com/jfmengels/all-contributors-cli/commits?author=pipey "Documentation")';
const expected = '[<img src="https://avatars1.githubusercontent.com/u/1500684" width="150px;"/><br /><sub><b>Who &#124; Needs &#124; Pipes?</b></sub>](http://github.com/chrisinajar)<br />[📖](https://github.com/jfmengels/all-contributors-cli/commits?author=pipey "Documentation")';
t.is(formatContributor(options, contributor), expected);
});