forked from sindresorhus/npm-user
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtest.js
More file actions
25 lines (22 loc) · 691 Bytes
/
test.js
File metadata and controls
25 lines (22 loc) · 691 Bytes
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
import test from 'ava';
import npmUser from './index.js';
test('user: sindresorhus', async t => {
const user = await npmUser('sindresorhus');
t.is(user.name, 'Sindre Sorhus');
t.regex(user.avatar, /npm-avatar/);
t.is(user.email, 'sindresorhus@gmail.com');
});
test('user: npm', async t => {
const user = await npmUser('npm');
t.is(user.name, 'No Problem, Meatbag');
t.regex(user.avatar, /npm-avatar/);
t.is(user.email, 'npm@npmjs.com');
});
test('user: tj', async t => {
const user = await npmUser('tj');
t.is(user.name, undefined);
t.regex(user.avatar, /npm-avatar/);
t.is(user.email, 'tj@vision-media.ca');
t.is(user.github, undefined);
t.is(user.twitter, undefined);
});