forked from wooorm/emoticon
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtest.js
35 lines (28 loc) · 1010 Bytes
/
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
'use strict'
var assert = require('assert')
var test = require('tape')
var emoticon = require('.')
test('emoticon', function(t) {
t.ok(Array.isArray(emoticon), 'should be an array')
t.doesNotThrow(function() {
emoticon.forEach(function(info) {
assert.equal(typeof info.emoji, 'string', JSON.stringify(info))
})
}, 'each entry should have an `emoji` string field')
t.doesNotThrow(function() {
emoticon.forEach(function(info) {
assert.equal(typeof info.description, 'string', JSON.stringify(info))
})
}, 'each entry should have an `description` string field')
t.doesNotThrow(function() {
emoticon.forEach(function(info) {
assert.ok(Array.isArray(info.tags), JSON.stringify(info))
})
}, 'each entry should have an `tags` array field')
t.doesNotThrow(function() {
emoticon.forEach(function(info) {
assert.ok(Array.isArray(info.emoticons), JSON.stringify(info))
})
}, 'each entry should have an `emoticons` array field')
t.end()
})