forked from ipfs-inactive/js-ipfs-http-client
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathlog.spec.js
42 lines (36 loc) · 963 Bytes
/
log.spec.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
/* eslint-env mocha */
/* globals apiClients */
'use strict'
const expect = require('chai').expect
const isNode = require('detect-node')
// For some reason these tests time out in PhantomJS so we need to skip them
const isPhantom = !isNode && typeof navigator !== 'undefined' && navigator.userAgent.match(/PhantomJS/)
describe('.log', () => {
it('.log.tail', (done) => {
if (isPhantom) {
return done()
}
const req = apiClients.a.log.tail((err, res) => {
expect(err).to.not.exist
expect(req).to.exist
res.once('data', (obj) => {
expect(obj).to.be.an('object')
done()
})
})
})
describe('promise', () => {
it('.log.tail', (done) => {
if (isPhantom) {
return done()
}
return apiClients.a.log.tail()
.then((res) => {
res.once('data', (obj) => {
expect(obj).to.be.an('object')
done()
})
})
})
})
})