Files
ipfs-bch-wallet-service/test/unit/controllers/json-rpc/about.json-rpc.controller.unit.js
T

40 lines
911 B
JavaScript
Raw Normal View History

2021-07-12 15:38:05 -07:00
/*
Unit tests for the json-rpc/about/index.js file.
*/
// Public npm libraries
2022-09-08 08:58:39 -07:00
import sinon from 'sinon'
import { assert } from 'chai'
2021-07-12 15:38:05 -07:00
// Local libraries
2022-09-08 08:58:39 -07:00
import AboutRPC from '../../../../src/controllers/json-rpc/about/index.js'
2021-07-12 15:38:05 -07:00
describe('#AboutRPC', () => {
let uut
let sandbox
beforeEach(() => {
sandbox = sinon.createSandbox()
uut = new AboutRPC()
})
afterEach(() => sandbox.restore())
describe('#aboutRouter', () => {
it('should return information about the service', async () => {
const result = await uut.aboutRouter()
// console.log('result: ', result)
assert.property(result, 'success')
assert.equal(result.success, true)
assert.property(result, 'status')
assert.equal(result.status, 200)
assert.property(result, 'message')
assert.property(result, 'endpoint')
assert.equal(result.endpoint, 'about')
})
})
})