-
Notifications
You must be signed in to change notification settings - Fork 0
/
test.js
37 lines (32 loc) · 1.14 KB
/
test.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
37
import test from 'ava';
import { random } from './dist/index';
test('without arguments it shows an emoticon', t => {
const a = random();
const cp = a.codePointAt();
t.assert(cp >= 0x1f600, 'greater than min');
t.assert(cp <= 0x1f64f, 'less than max');
});
test('with argument "emoticons" it shows an emoticon', t => {
const a = random('emoticons');
const cp = a.codePointAt();
t.assert(cp >= 0x1f600, 'greater than min');
t.assert(cp <= 0x1f64f, 'less than max');
});
test('with argument "food" it shows a food emoji', t => {
const a = random('food');
const cp = a.codePointAt();
t.assert(cp >= 0x1f32d, 'greater than min');
t.assert(cp <= 0x1f37f, 'less than max');
});
test('with argument "animals" it shows an animal friend emoji', t => {
const a = random('animals');
const cp = a.codePointAt();
t.assert(cp >= 0x1f400, 'greater than min');
t.assert(cp <= 0x1f4d3, 'less than max');
});
test('with argument "expressions" it shows an facial expression emoji', t => {
const a = random('expressions');
const cp = a.codePointAt();
t.assert(cp >= 0x1f910, 'greater than min');
t.assert(cp <= 0x1f92f, 'less than max');
});