mirror of
https://github.com/Permissionless-Software-Foundation/bch-dex.git
synced 2026-09-22 01:02:00 -07:00
39 lines
754 B
JavaScript
39 lines
754 B
JavaScript
/*
|
|
Unit tests for controllers index.js file.
|
|
*/
|
|
|
|
// Public npm libraries
|
|
// const assert = require('chai').assert
|
|
import sinon from 'sinon'
|
|
|
|
import Controllers from '../../../src/controllers/index.js'
|
|
|
|
describe('#Controllers', () => {
|
|
let uut
|
|
let sandbox
|
|
|
|
beforeEach(() => {
|
|
sandbox = sinon.createSandbox()
|
|
|
|
uut = new Controllers()
|
|
})
|
|
|
|
afterEach(() => sandbox.restore())
|
|
|
|
describe('#attachControllers', () => {
|
|
it('should attach the controllers', async () => {
|
|
// mock IPFS
|
|
sandbox.stub(uut.adapters, 'start').resolves({})
|
|
uut.adapters.ipfs.ipfsCoordAdapter = {
|
|
attachRPCRouter: () => {}
|
|
}
|
|
|
|
const app = {
|
|
use: () => {}
|
|
}
|
|
|
|
await uut.attachControllers(app)
|
|
})
|
|
})
|
|
})
|