Small style tweaks

This commit is contained in:
Jeroen Engels 2016-06-28 11:34:32 +02:00
parent c4d04d00ee
commit a6b818f755

View file

@ -2,18 +2,18 @@ import test from 'ava';
import nock from 'nock'; import nock from 'nock';
import getUserInfo from './github'; import getUserInfo from './github';
test.cb('should handle errors', function (t) { test.cb('should handle errors', t => {
nock('https://api.github.com') nock('https://api.github.com')
.get('/users/nodisplayname') .get('/users/nodisplayname')
.replyWithError(404); .replyWithError(404);
getUserInfo('nodisplayname', function (err) { getUserInfo('nodisplayname', err => {
t.truthy(err); t.truthy(err);
t.end(); t.end();
}); });
}); });
test.cb('should fill in the name when null is returned', function (t) { test.cb('should fill in the name when null is returned', t => {
nock('https://api.github.com') nock('https://api.github.com')
.get('/users/nodisplayname') .get('/users/nodisplayname')
.reply(200, { .reply(200, {
@ -23,14 +23,14 @@ test.cb('should fill in the name when null is returned', function (t) {
html_url: 'https://github.com/nodisplayname' html_url: 'https://github.com/nodisplayname'
}); });
getUserInfo('nodisplayname', function (err, info) { getUserInfo('nodisplayname', (err, info) => {
t.falsy(err); t.falsy(err);
t.is(info.name, 'nodisplayname'); t.is(info.name, 'nodisplayname');
t.end(); t.end();
}); });
}); });
test.cb('should fill in the name when an empty string is returned', function (t) { test.cb('should fill in the name when an empty string is returned', t => {
nock('https://api.github.com') nock('https://api.github.com')
.get('/users/nodisplayname') .get('/users/nodisplayname')
.reply(200, { .reply(200, {
@ -40,7 +40,7 @@ test.cb('should fill in the name when an empty string is returned', function (t)
html_url: 'https://github.com/nodisplayname' html_url: 'https://github.com/nodisplayname'
}); });
getUserInfo('nodisplayname', function (err, info) { getUserInfo('nodisplayname', (err, info) => {
t.falsy(err); t.falsy(err);
t.is(info.name, 'nodisplayname'); t.is(info.name, 'nodisplayname');
t.end(); t.end();