forked from ipfs-service-provider

This commit is contained in:
Chris Troutner
2021-11-23 08:38:01 -08:00
commit 8f7f3896a3
115 changed files with 58101 additions and 0 deletions
+38
View File
@@ -0,0 +1,38 @@
/*
Unit tests for controllers index.js file.
*/
// Public npm libraries
// const assert = require('chai').assert
const sinon = require('sinon')
const Controllers = require('../../../src/controllers')
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)
})
})
})