fix(startup): Added hooks for async startup

This commit is contained in:
Chris Troutner
2022-06-27 10:09:08 -07:00
parent 0333f77f5a
commit f117fe15df
9 changed files with 57 additions and 8 deletions
+1
View File
@@ -7,6 +7,7 @@
// Public npm libraries
const assert = require('chai').assert
const axios = require('axios').default
// const sinon = require('sinon')
// Local support libraries
const config = require('../../../config')
+2 -1
View File
@@ -37,8 +37,9 @@ describe('#adapters', () => {
it('should catch and throw an error', async () => {
try {
// Force an error
// Force an error
uut.config.getJwtAtStartup = false
uut.config.env = 'dev'
sandbox.stub(uut.ipfs, 'start').rejects(new Error('test error'))
await uut.start()
+2
View File
@@ -24,6 +24,8 @@ describe('#server', () => {
it('should start the server', async () => {
// Mock dependencies
sandbox.stub(uut.mongoose, 'connect').resolves()
sandbox.stub(uut.controllers, 'initAdapters').resolves()
sandbox.stub(uut.controllers, 'initUseCases').resolves()
sandbox.stub(uut.controllers, 'attachRESTControllers').resolves()
sandbox.stub(uut.adminLib, 'createSystemUser').resolves(true)
sandbox.stub(uut.controllers, 'attachControllers').resolves()