-
Notifications
You must be signed in to change notification settings - Fork 8
/
test.js
44 lines (36 loc) · 931 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
36
37
38
39
40
41
42
43
44
const {expect} = require('chai')
const {describe, it, before} = require('mocha')
const profiles = require('.')
describe('ownerProfiles', () => {
var owner
before(async () => {
owner = await profiles.get('juliangruber')
})
it('returns a user object if it exists', () => {
expect(owner).to.be.an('object')
})
it('includes twitter', () => {
expect(owner.twitter).to.be.a('string')
})
it('includes email', () => {
expect(owner.email).to.be.a('string')
})
it('includes github', () => {
expect(owner.github).to.be.a('string')
})
it('includes name', () => {
expect(owner.name).to.be.a('string')
})
it('has lots of entries', function (done) {
this.timeout(10 * 1000)
let count = 0
profiles.createReadStream()
.on('data', (data) => {
count++
})
.on('end', () => {
expect(count).to.be.above(169 * 1000)
done()
})
})
})