src/test/testClientSupport.js
/**
   * @summary **Start an in-process version of the server**
   * @description
   * The mocksock socket.io simulator is used with the express.js server
   * to create an in-process version of the mMeddle server. Since there is
   * no actual network IO problems can often be isolated more easily.
   * This also helps in getting code coverage since both sides of the
   * client/server pair are tested concurrently.
   * @alias module:test/testClientSupport.mockMeddleServer
   */
@summary **Start an in-process version of the server
@description
The mocksock socket.io simulator is used with the express.js server
to create an in-process version of the mMeddle server. Since there is
no actual network IO problems can often be isolated more easily.
This also helps in getting code coverage since both sides of the
client/server pair are tested concurrently.
@summary ** Start an in - process version of the server @description The mocksock socket . io simulator is used with the express . js server to create an in - process version of the mMeddle server . Since there is no actual network IO problems can often be isolated more easily . This also helps in getting code coverage since both sides of the client / server pair are tested concurrently .
function mockMeddleServer() {
    try {
      var appName = 'mockServer';
      mm.log.setupAppDebugLog(appName);
      mm.config = mm.config.appLoad(appName);
      mm.log.debug('----- Server Configuration -----\n', mm.config);
      var mmServer = new mm.server.MMeddleServer(mm.config.baseDir);
      mmServer.setupTerminationHandlers();
      mmServer.initializeServer();
      mmServer.start();
      var storageEngine = new mm.storage.StorageEngine();
      if (!mm.util.mmEnvOption('NOFS', false)) {
        mm.storage.providers.FileProvider.register(storageEngine);
      }
      if (!mm.util.mmEnvOption('NODB', false)) {
        mm.storage.providers.MongoDBProvider.register(storageEngine);
      }
      var socketService = new mm.server.SocketService();
      socketService.initializeService(mmServer, storageEngine);
      socketService.acceptConnections();
      mm.test.server.mmServer = mmServer;
      mm.test.server.socketService = socketService;
    }
    catch (e) {
      mm.log.error('- Mock mMeddle Server failure:', e.stack);
    }
  }
function mockMeddleServer ( ) { try { var appName = 'mockServer' ; mm . log . setupAppDebugLog ( appName ) ; mm . config = mm . config . appLoad ( appName ) ; mm . log . debug ( '----- Server Configuration -----\n' , mm . config ) ; var mmServer = new mm . server . MMeddleServer ( mm . config . baseDir ) ; mmServer . setupTerminationHandlers ( ) ; mmServer . initializeServer ( ) ; mmServer . start ( ) ; var storageEngine = new mm . storage . StorageEngine ( ) ; if ( ! mm . util . mmEnvOption ( 'NOFS' , false ) ) { mm . storage . providers . FileProvider . register ( storageEngine ) ; } if ( ! mm . util . mmEnvOption ( 'NODB' , false ) ) { mm . storage . providers . MongoDBProvider . register ( storageEngine ) ; } var socketService = new mm . server . SocketService ( ) ; socketService . initializeService ( mmServer , storageEngine ) ; socketService . acceptConnections ( ) ; mm . test . server . mmServer = mmServer ; mm . test . server . socketService = socketService ; } catch ( e ) { mm . log . error ( '- Mock mMeddle Server failure:' , e . stack ) ; } }
@summary **Start an in-process version of the server
 @description
 The mocksock socket.io simulator is used with the express.js server
 to create an in-process version of the mMeddle server.
@summary ** Start an in - process version of the server @description The mocksock socket . io simulator is used with the express . js server to create an in - process version of the mMeddle server .