forked from ipfs-inactive/js-ipfs-http-client
-
Notifications
You must be signed in to change notification settings - Fork 0
/
diag.spec.js
58 lines (51 loc) · 1.23 KB
/
diag.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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
/* eslint-env mocha */
/* globals apiClients */
'use strict'
const expect = require('chai').expect
describe('.diag', () => {
it('.diag.net', (done) => {
apiClients.a.diag.net((err, res) => {
expect(err).to.not.exist
expect(res).to.exist
done()
})
})
it('.diag.sys', (done) => {
apiClients.a.diag.sys((err, res) => {
expect(err).to.not.exist
expect(res).to.exist
expect(res).to.have.a.property('memory')
expect(res).to.have.a.property('diskinfo')
done()
})
})
it('.diag.cmds', (done) => {
apiClients.a.diag.cmds((err, res) => {
expect(err).to.not.exist
expect(res).to.exist
done()
})
})
describe('promise', () => {
it('.diag.net', () => {
return apiClients.a.diag.net()
.then((res) => {
expect(res).to.exist
})
})
it('.diag.sys', () => {
return apiClients.a.diag.sys()
.then((res) => {
expect(res).to.exist
expect(res).to.have.a.property('memory')
expect(res).to.have.a.property('diskinfo')
})
})
it('.diag.cmds', () => {
return apiClients.a.diag.cmds()
.then((res) => {
expect(res).to.exist
})
})
})
})