@futdevpro/nts-dynamo 1.6.19 → 1.6.21
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/_constants/mocks/app-extended-server.mock.d.ts +41 -0
- package/lib/_constants/mocks/app-extended-server.mock.d.ts.map +1 -0
- package/lib/_constants/mocks/app-extended-server.mock.js +168 -0
- package/lib/_constants/mocks/app-extended-server.mock.js.map +1 -0
- package/lib/_constants/mocks/app-server.mock.d.ts +1 -1
- package/lib/_constants/mocks/app-server.mock.d.ts.map +1 -1
- package/lib/_constants/mocks/app-server.mock.js +12 -5
- package/lib/_constants/mocks/app-server.mock.js.map +1 -1
- package/lib/_constants/mocks/data-model.mock.d.ts +27 -0
- package/lib/_constants/mocks/data-model.mock.d.ts.map +1 -0
- package/lib/_constants/mocks/data-model.mock.js +57 -0
- package/lib/_constants/mocks/data-model.mock.js.map +1 -0
- package/lib/_constants/mocks/email-service-collection.mock.d.ts +7 -0
- package/lib/_constants/mocks/email-service-collection.mock.d.ts.map +1 -0
- package/lib/_constants/mocks/email-service-collection.mock.js +16 -0
- package/lib/_constants/mocks/email-service-collection.mock.js.map +1 -0
- package/lib/_constants/mocks/email-service.mock.d.ts +5 -0
- package/lib/_constants/mocks/email-service.mock.d.ts.map +1 -0
- package/lib/_constants/mocks/email-service.mock.js +21 -0
- package/lib/_constants/mocks/email-service.mock.js.map +1 -0
- package/lib/_constants/mocks/socket-client.mock.d.ts +9 -0
- package/lib/_constants/mocks/socket-client.mock.d.ts.map +1 -0
- package/lib/_constants/mocks/socket-client.mock.js +39 -0
- package/lib/_constants/mocks/socket-client.mock.js.map +1 -0
- package/lib/_constants/mocks/socket-server.mock.d.ts +1 -0
- package/lib/_constants/mocks/socket-server.mock.d.ts.map +1 -1
- package/lib/_constants/mocks/socket-server.mock.js +4 -1
- package/lib/_constants/mocks/socket-server.mock.js.map +1 -1
- package/lib/_models/control-models/app-system-controls.control-model copy.d.ts +7 -0
- package/lib/_models/control-models/app-system-controls.control-model copy.d.ts.map +1 -0
- package/lib/_models/control-models/app-system-controls.control-model copy.js +13 -0
- package/lib/_models/control-models/app-system-controls.control-model copy.js.map +1 -0
- package/lib/_models/control-models/app-system-controls.control-model.d.ts +8 -0
- package/lib/_models/control-models/app-system-controls.control-model.d.ts.map +1 -0
- package/lib/_models/control-models/app-system-controls.control-model.js +14 -0
- package/lib/_models/control-models/app-system-controls.control-model.js.map +1 -0
- package/lib/_models/control-models/system-control.control-model.d.ts +6 -0
- package/lib/_models/control-models/system-control.control-model.d.ts.map +1 -0
- package/lib/_models/control-models/system-control.control-model.js +15 -0
- package/lib/_models/control-models/system-control.control-model.js.map +1 -0
- package/lib/_services/base/db.service.d.ts +1 -2
- package/lib/_services/base/db.service.d.ts.map +1 -1
- package/lib/_services/base/db.service.js +23 -15
- package/lib/_services/base/db.service.js.map +1 -1
- package/lib/_services/core/email.service.d.ts.map +1 -1
- package/lib/_services/core/email.service.js +0 -1
- package/lib/_services/core/email.service.js.map +1 -1
- package/lib/_services/server/app-extended.server.d.ts +9 -0
- package/lib/_services/server/app-extended.server.d.ts.map +1 -1
- package/lib/_services/server/app-extended.server.js +228 -81
- package/lib/_services/server/app-extended.server.js.map +1 -1
- package/lib/_services/server/app-extended.server.spec.d.ts +2 -0
- package/lib/_services/server/app-extended.server.spec.d.ts.map +1 -0
- package/lib/_services/server/app-extended.server.spec.js +55 -0
- package/lib/_services/server/app-extended.server.spec.js.map +1 -0
- package/lib/_services/server/app.server.d.ts +17 -17
- package/lib/_services/server/app.server.d.ts.map +1 -1
- package/lib/_services/server/app.server.js +382 -258
- package/lib/_services/server/app.server.js.map +1 -1
- package/lib/_services/server/app.server.spec.js +17 -5
- package/lib/_services/server/app.server.spec.js.map +1 -1
- package/lib/_services/shared.service.spec.js +7 -1
- package/lib/_services/shared.service.spec.js.map +1 -1
- package/lib/_services/socket/socket-server.service.d.ts +5 -3
- package/lib/_services/socket/socket-server.service.d.ts.map +1 -1
- package/lib/_services/socket/socket-server.service.js +32 -7
- package/lib/_services/socket/socket-server.service.js.map +1 -1
- package/lib/tsconfig.tsbuildinfo +1 -1
- package/package.json +2 -2
- package/src/_constants/mocks/app-extended-server.mock.ts +191 -0
- package/src/_constants/mocks/app-server.mock.ts +10 -5
- package/src/_constants/mocks/data-model.mock.ts +83 -0
- package/src/_constants/mocks/email-service-collection.mock.ts +12 -0
- package/src/_constants/mocks/email-service.mock.ts +19 -0
- package/src/_constants/mocks/email-template.mock.html +15 -0
- package/src/_constants/mocks/socket-client.mock.ts +42 -0
- package/src/_constants/mocks/socket-server.mock.ts +5 -1
- package/src/_models/control-models/app-system-controls.control-model copy.ts +9 -0
- package/src/_models/control-models/app-system-controls.control-model.ts +9 -0
- package/src/_models/control-models/system-control.control-model.ts +13 -0
- package/src/_services/base/db.service.ts +25 -15
- package/src/_services/core/email.service.ts +0 -1
- package/src/_services/server/app-extended.server.spec.ts +66 -0
- package/src/_services/server/app-extended.server.ts +205 -41
- package/src/_services/server/app.server.spec.ts +17 -7
- package/src/_services/server/app.server.ts +284 -165
- package/src/_services/shared.service.spec.ts +10 -1
- package/src/_services/socket/socket-server.service.ts +36 -12
|
@@ -2,12 +2,13 @@
|
|
|
2
2
|
import * as SocketIO from 'socket.io';
|
|
3
3
|
import * as Http from 'http';
|
|
4
4
|
|
|
5
|
-
import { Dynamo_Log } from '@futdevpro/fsm-dynamo';
|
|
5
|
+
import { delay, Dynamo_Array, Dynamo_Error, Dynamo_Log, second, wait } from '@futdevpro/fsm-dynamo';
|
|
6
6
|
|
|
7
7
|
import { DynamoNTS_App } from './app.server';
|
|
8
8
|
import { DynamoNTS_RouteSecurity } from '../../_enums/route-security.enum';
|
|
9
9
|
import { DynamoNTS_SocketServerService } from '../socket/socket-server.service';
|
|
10
10
|
import { DynamoNTS_SocketSecurity } from '../../_enums/socket-security.enum';
|
|
11
|
+
import { DynamoNTS_AppExtSysControls } from '../../_models/control-models/app-system-controls.control-model copy';
|
|
11
12
|
|
|
12
13
|
/**
|
|
13
14
|
* This will be the MAIN service of our server project,
|
|
@@ -110,8 +111,15 @@ import { DynamoNTS_SocketSecurity } from '../../_enums/socket-security.enum';
|
|
|
110
111
|
* }
|
|
111
112
|
*/
|
|
112
113
|
export abstract class DynamoNTS_AppExtended extends DynamoNTS_App {
|
|
114
|
+
|
|
115
|
+
private systemControlsExt: DynamoNTS_AppExtSysControls = new DynamoNTS_AppExtSysControls();
|
|
116
|
+
override get started(): boolean { return this.systemControlsExt.appExtended.started; }
|
|
117
|
+
private httpsSocketCount: number = 0;
|
|
118
|
+
private httpSocketCount: number = 0;
|
|
113
119
|
|
|
114
120
|
private socketSecurity: DynamoNTS_RouteSecurity;
|
|
121
|
+
|
|
122
|
+
private httpSocketServer: Http.Server;
|
|
115
123
|
|
|
116
124
|
/**
|
|
117
125
|
* @example
|
|
@@ -123,27 +131,147 @@ export abstract class DynamoNTS_AppExtended extends DynamoNTS_App {
|
|
|
123
131
|
* ];
|
|
124
132
|
*/
|
|
125
133
|
protected socketServices: DynamoNTS_SocketServerService<any>[];
|
|
134
|
+
private allSocketServers: SocketIO.Server[] = [];
|
|
126
135
|
|
|
127
136
|
constructor(){
|
|
128
|
-
super();
|
|
137
|
+
super(true);
|
|
138
|
+
|
|
139
|
+
this.asyncConstructExt();
|
|
140
|
+
}
|
|
129
141
|
|
|
142
|
+
private async asyncConstructExt(): Promise<void> {
|
|
143
|
+
if (this.logFn && this.deepLog) console.log('\nfn:. asyncConstruct-extended');
|
|
130
144
|
try {
|
|
145
|
+
this.systemControlsExt.appExtended.init = true;
|
|
146
|
+
|
|
131
147
|
this.socketServices = this.getSocketServices();
|
|
132
148
|
|
|
133
149
|
if (this.socketServices?.length) {
|
|
134
150
|
this.setSocketSecurity();
|
|
135
151
|
|
|
136
|
-
this.setupSocketServerServices();
|
|
137
|
-
|
|
138
|
-
if (this.debugLog) console.log(`\nAll sockets setted up.... sockets using security: ${this.socketSecurity}`);
|
|
152
|
+
await this.setupSocketServerServices();
|
|
153
|
+
if (this.logSetup) console.log(`\nAll sockets setted up.... sockets using security: ${this.socketSecurity}`);
|
|
139
154
|
} else {
|
|
140
|
-
Dynamo_Log.
|
|
155
|
+
Dynamo_Log.testWarn(
|
|
141
156
|
'\nNo socketServices setted up while using Extended Application.',
|
|
142
157
|
'\nYou should use DynamoNTS_App if you don`t need socket services.\n'
|
|
143
158
|
);
|
|
144
159
|
}
|
|
160
|
+
|
|
161
|
+
await this.ready();
|
|
162
|
+
|
|
163
|
+
Dynamo_Log.test(`${this.params.name} started successfully.`);
|
|
145
164
|
} catch (error) {
|
|
146
|
-
Dynamo_Log.error(
|
|
165
|
+
Dynamo_Log.error(`\nExtended Application: ${this.params?.name} start failed.\n`, error, '\n');
|
|
166
|
+
}
|
|
167
|
+
}
|
|
168
|
+
|
|
169
|
+
override async ready(timeout: number = 4 * second): Promise<void> {
|
|
170
|
+
if (this.logFn) console.log('\nfn:. ready-extended');
|
|
171
|
+
await super.ready(timeout);
|
|
172
|
+
|
|
173
|
+
let ready: boolean = false;
|
|
174
|
+
const start: number = +new Date();
|
|
175
|
+
|
|
176
|
+
if (this.constructErrors.length) {
|
|
177
|
+
Dynamo_Log.error(`Extended Application: ${this.params?.name} start failed. ERRORS`, this.constructErrors, '\n');
|
|
178
|
+
throw new Dynamo_Error({
|
|
179
|
+
message: `${this.params?.name} start failed. ERRORS`,
|
|
180
|
+
additionalContent: this.constructErrors,
|
|
181
|
+
error: this.constructErrors?.[0] ?? new Error()
|
|
182
|
+
});
|
|
183
|
+
}
|
|
184
|
+
|
|
185
|
+
while (!ready && +new Date() - start < timeout) {
|
|
186
|
+
if (this.systemControlsExt.appExtended.init) {
|
|
187
|
+
ready = (
|
|
188
|
+
this.superStarted &&
|
|
189
|
+
this.systemControlsExt.httpSocketServer.getReady() &&
|
|
190
|
+
this.systemControlsExt.httpsSocketServer.getReady()
|
|
191
|
+
);
|
|
192
|
+
}
|
|
193
|
+
|
|
194
|
+
await wait(100);
|
|
195
|
+
}
|
|
196
|
+
|
|
197
|
+
if (this.constructErrors.length) {
|
|
198
|
+
Dynamo_Log.error(`Extended Application: ${this.params?.name} start failed. TIMEOUT`, this.constructErrors, '\n');
|
|
199
|
+
throw new Dynamo_Error({
|
|
200
|
+
message: `${this.params?.name} start failed. TIMEOUT`,
|
|
201
|
+
additionalContent: this.constructErrors,
|
|
202
|
+
error: this.constructErrors?.[0] ?? new Error()
|
|
203
|
+
});
|
|
204
|
+
}
|
|
205
|
+
|
|
206
|
+
if (ready) {
|
|
207
|
+
this.systemControlsExt.appExtended.started = true;
|
|
208
|
+
|
|
209
|
+
if (this.logFn && this.deepLog) console.log('\nfn:. ready-extended: return');
|
|
210
|
+
return;
|
|
211
|
+
} else {
|
|
212
|
+
this.systemControlsExt.appExtended.started = false;
|
|
213
|
+
|
|
214
|
+
let msg: string = `${this.params?.name} start failed. UNKNOWN`;
|
|
215
|
+
if (this.systemControlsExt.httpSocketServer.init && !this.systemControlsExt.httpSocketServer.started) {
|
|
216
|
+
msg += '\nhttpSocketServer start failed.';
|
|
217
|
+
}
|
|
218
|
+
if (this.systemControlsExt.httpsSocketServer.init && !this.systemControlsExt.httpsSocketServer.started) {
|
|
219
|
+
msg += '\nhttpsSocketServer start failed.';
|
|
220
|
+
}
|
|
221
|
+
|
|
222
|
+
Dynamo_Log.error(msg, this.constructErrors, '\n');
|
|
223
|
+
throw new Dynamo_Error({
|
|
224
|
+
errorCode: 'NTS-AES-110',
|
|
225
|
+
message: msg,
|
|
226
|
+
additionalContent: {
|
|
227
|
+
constructErrors: this.constructErrors,
|
|
228
|
+
systemControls: this.systemControls,
|
|
229
|
+
systemControlsExt: this.systemControlsExt,
|
|
230
|
+
systemReadies: {
|
|
231
|
+
app: this.systemControls.app.getReady(),
|
|
232
|
+
appExtended: this.systemControlsExt.appExtended.getReady(),
|
|
233
|
+
mongoose: this.systemControls.mongoose.getReady(),
|
|
234
|
+
httpServer: this.systemControls.httpServer.getReady(),
|
|
235
|
+
httpsServer: this.systemControls.httpsServer.getReady(),
|
|
236
|
+
httpSocketServer: this.systemControlsExt.httpSocketServer.getReady(),
|
|
237
|
+
httpsSocketServer: this.systemControlsExt.httpsSocketServer.getReady(),
|
|
238
|
+
},
|
|
239
|
+
},
|
|
240
|
+
error: this.constructErrors?.[0] ?? new Error()
|
|
241
|
+
});
|
|
242
|
+
}
|
|
243
|
+
}
|
|
244
|
+
|
|
245
|
+
override async stop(): Promise<void> {
|
|
246
|
+
if (this.logFn) console.log('\nfn:. stop-extended');
|
|
247
|
+
if (this.started) {
|
|
248
|
+
await super.stop(true);
|
|
249
|
+
|
|
250
|
+
this.systemControlsExt.httpSocketServer.started = false;
|
|
251
|
+
this.systemControlsExt.httpsSocketServer.started = false;
|
|
252
|
+
await Dynamo_Array.asyncForEach(this.allSocketServers, async (socketServer: SocketIO.Server) => {
|
|
253
|
+
await new Promise<void>((resolve, reject) => {
|
|
254
|
+
socketServer.disconnectSockets(true);
|
|
255
|
+
socketServer.close((err) => {
|
|
256
|
+
if (err) {
|
|
257
|
+
Dynamo_Log.error(`\nHTTP socket server close error`, err);
|
|
258
|
+
reject(
|
|
259
|
+
new Dynamo_Error({
|
|
260
|
+
errorCode: 'NTS-AES-120',
|
|
261
|
+
message: `SocketServer close failed.`,
|
|
262
|
+
error: err
|
|
263
|
+
})
|
|
264
|
+
);
|
|
265
|
+
} else {
|
|
266
|
+
resolve();
|
|
267
|
+
}
|
|
268
|
+
});
|
|
269
|
+
});
|
|
270
|
+
});
|
|
271
|
+
this.systemControlsExt.httpSocketServer.init = false;
|
|
272
|
+
this.systemControlsExt.httpsSocketServer.init = false;
|
|
273
|
+
|
|
274
|
+
Dynamo_Log.test(`${this.params.name} stopped successfully.`);
|
|
147
275
|
}
|
|
148
276
|
}
|
|
149
277
|
|
|
@@ -151,6 +279,7 @@ export abstract class DynamoNTS_AppExtended extends DynamoNTS_App {
|
|
|
151
279
|
*
|
|
152
280
|
*/
|
|
153
281
|
private setSocketSecurity(): void {
|
|
282
|
+
if (this.logFn) console.log('\nfn:. setSocketSecurity');
|
|
154
283
|
this.socketServices.forEach((service: DynamoNTS_SocketServerService<any>) => {
|
|
155
284
|
if (!this.socketSecurity) {
|
|
156
285
|
this.socketSecurity = DynamoNTS_RouteSecurity[service.security];
|
|
@@ -163,20 +292,23 @@ export abstract class DynamoNTS_AppExtended extends DynamoNTS_App {
|
|
|
163
292
|
/**
|
|
164
293
|
*
|
|
165
294
|
*/
|
|
166
|
-
private setupSocketServerServices(): void {
|
|
295
|
+
private async setupSocketServerServices(): Promise<void> {
|
|
167
296
|
try {
|
|
168
|
-
|
|
297
|
+
if (this.logFn) console.log('\nfn:. setupSocketServerServices');
|
|
298
|
+
/* let httpServer: Http.Server; */
|
|
169
299
|
if (this.socketSecurity !== DynamoNTS_RouteSecurity.secure) {
|
|
170
300
|
if (!this.openExpress) {
|
|
171
|
-
this.initOpenExpress();
|
|
301
|
+
await this.initOpenExpress();
|
|
302
|
+
}
|
|
303
|
+
if (!this.httpSocketServer) {
|
|
304
|
+
this.httpSocketServer = Http.createServer(this.openExpress);
|
|
172
305
|
}
|
|
173
|
-
httpSocketServer = Http.createServer(this.openExpress);
|
|
174
306
|
}
|
|
175
307
|
|
|
176
308
|
if (this.socketSecurity !== DynamoNTS_RouteSecurity.open) {
|
|
177
309
|
if (!this.httpsServer) {
|
|
178
310
|
if (this.cert) {
|
|
179
|
-
this.initSecureExpress();
|
|
311
|
+
await this.initSecureExpress();
|
|
180
312
|
} else {
|
|
181
313
|
let errorMsg: string =
|
|
182
314
|
`\nYou have secure socket service, but the certification paths are not set!` +
|
|
@@ -190,7 +322,7 @@ export abstract class DynamoNTS_AppExtended extends DynamoNTS_App {
|
|
|
190
322
|
errorMsg += '\n\nThe socket services setted to use secure server:';
|
|
191
323
|
this.socketServices.forEach((service: DynamoNTS_SocketServerService<any>) => {
|
|
192
324
|
if (service.security != DynamoNTS_SocketSecurity.open) {
|
|
193
|
-
errorMsg += `\n ${service
|
|
325
|
+
errorMsg += `\n ${service?.name} (port: ${service.port})`;
|
|
194
326
|
}
|
|
195
327
|
});
|
|
196
328
|
Dynamo_Log.error(errorMsg);
|
|
@@ -205,42 +337,74 @@ export abstract class DynamoNTS_AppExtended extends DynamoNTS_App {
|
|
|
205
337
|
}
|
|
206
338
|
}
|
|
207
339
|
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
340
|
+
await Dynamo_Array.asyncForEach(
|
|
341
|
+
this.socketServices,
|
|
342
|
+
async (service: DynamoNTS_SocketServerService<any>) => {
|
|
343
|
+
try {
|
|
344
|
+
this.systemControlsExt.httpSocketServer.init = true;
|
|
345
|
+
const existingPorts: DynamoNTS_SocketServerService<any>[] = this.socketServices.filter(
|
|
346
|
+
(mod: DynamoNTS_SocketServerService<any>) => mod.port === service.port
|
|
347
|
+
);
|
|
213
348
|
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
349
|
+
if (1 < existingPorts.length || this.ports.httpPort === service.port || this.ports.httpsPort === service.port) {
|
|
350
|
+
let error = new Error(`PORT DUPLICATION: ${service.port}`);
|
|
351
|
+
let errorStack: string[] = error.stack.split('\n');
|
|
352
|
+
errorStack.splice(1, 4);
|
|
353
|
+
error.stack = errorStack.join('\n');
|
|
219
354
|
|
|
220
|
-
|
|
221
|
-
|
|
355
|
+
throw error;
|
|
356
|
+
}
|
|
222
357
|
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
358
|
+
if (service.security === DynamoNTS_SocketSecurity.open) {
|
|
359
|
+
if (this.logSetup) console.log(`\nsocket setup (open): ${service?.name}:${service.port}`);
|
|
360
|
+
this.httpSocketCount++;
|
|
361
|
+
this.systemControlsExt.httpSocketServer.started = false;
|
|
226
362
|
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
363
|
+
this.allSocketServers.push(
|
|
364
|
+
await service.setupSocketServer(
|
|
365
|
+
new SocketIO.Server(this.httpSocketServer),
|
|
366
|
+
DynamoNTS_SocketSecurity.open,
|
|
367
|
+
() => {
|
|
368
|
+
this.httpSocketCount--;
|
|
369
|
+
if (this.httpSocketCount === 0) {
|
|
370
|
+
this.systemControlsExt.httpSocketServer.started = true;
|
|
371
|
+
}
|
|
372
|
+
}
|
|
373
|
+
)
|
|
374
|
+
);
|
|
375
|
+
|
|
376
|
+
} else if (service.security === DynamoNTS_SocketSecurity.secure) {
|
|
377
|
+
if (this.logSetup) console.log(`\nsocket setup (secure): ${service?.name}:${service.port}`);
|
|
378
|
+
this.httpsSocketCount++;
|
|
379
|
+
this.systemControlsExt.httpsSocketServer.started = false;
|
|
236
380
|
|
|
381
|
+
this.allSocketServers.push(
|
|
382
|
+
await service.setupSocketServer(
|
|
383
|
+
new SocketIO.Server(this.httpsServer),
|
|
384
|
+
DynamoNTS_SocketSecurity.secure,
|
|
385
|
+
() => {
|
|
386
|
+
this.httpsSocketCount--;
|
|
387
|
+
if (this.httpsSocketCount === 0) {
|
|
388
|
+
this.systemControlsExt.httpsSocketServer.started = true;
|
|
389
|
+
}
|
|
390
|
+
}
|
|
391
|
+
)
|
|
392
|
+
);
|
|
393
|
+
|
|
394
|
+
} else {
|
|
395
|
+
let error = new Error(`INVALID Socket Service security: ${service.security} on ${service?.name}`);
|
|
396
|
+
let errorStack: string[] = error.stack.split('\n');
|
|
397
|
+
errorStack.splice(1, 4);
|
|
398
|
+
error.stack = errorStack.join('\n');
|
|
399
|
+
|
|
400
|
+
throw error;
|
|
401
|
+
}
|
|
402
|
+
} catch (error) {
|
|
403
|
+
Dynamo_Log.error(`\nSocket Server service setup failed. (${service?.name})\n`, error, '\n');
|
|
237
404
|
throw error;
|
|
238
405
|
}
|
|
239
|
-
} catch (error) {
|
|
240
|
-
Dynamo_Log.error(`\nSocket Server service setup failed. (${service.name})\n`, error, '\n');
|
|
241
|
-
throw error;
|
|
242
406
|
}
|
|
243
|
-
|
|
407
|
+
);
|
|
244
408
|
} catch (error) {
|
|
245
409
|
Dynamo_Log.error(`\nSocket Server services setup failed. (${this.socketServices?.length} services)\n`, error, '\n');
|
|
246
410
|
throw error;
|
|
@@ -1,14 +1,21 @@
|
|
|
1
1
|
|
|
2
|
-
import { delay } from '@futdevpro/fsm-dynamo';
|
|
2
|
+
import { delay, Dynamo_Log, second } from '@futdevpro/fsm-dynamo';
|
|
3
|
+
import { DynamoNTS_AppExtendedBase_Mock, DynamoNTS_AppExtendedFull_Mock } from '../../_constants/mocks/app-extended-server.mock';
|
|
3
4
|
import { DynamoNTS_AppBase_Mock, DynamoNTS_AppFull_Mock } from '../../_constants/mocks/app-server.mock';
|
|
4
5
|
|
|
5
|
-
describe('DynamoNTS_App
|
|
6
|
+
describe('DynamoNTS_App AND DynamoNTS_AppExtended?;', () => {
|
|
7
|
+
// jasmine.DEFAULT_TIMEOUT_INTERVAL = 15 * second;
|
|
8
|
+
|
|
6
9
|
describe('a base instance;', () => {
|
|
7
10
|
let app: DynamoNTS_AppBase_Mock;
|
|
8
11
|
|
|
9
12
|
beforeEach(async () => {
|
|
10
|
-
|
|
11
|
-
|
|
13
|
+
try {
|
|
14
|
+
app = new DynamoNTS_AppBase_Mock();
|
|
15
|
+
await app.ready();
|
|
16
|
+
} catch (error) {
|
|
17
|
+
Dynamo_Log.test('error', error);
|
|
18
|
+
}
|
|
12
19
|
});
|
|
13
20
|
|
|
14
21
|
afterEach(async () => {
|
|
@@ -28,8 +35,12 @@ describe('DynamoNTS_App;', () => {
|
|
|
28
35
|
let app: DynamoNTS_AppFull_Mock;
|
|
29
36
|
|
|
30
37
|
beforeEach(async () => {
|
|
31
|
-
|
|
32
|
-
|
|
38
|
+
try {
|
|
39
|
+
app = new DynamoNTS_AppFull_Mock();
|
|
40
|
+
await app.ready();
|
|
41
|
+
} catch (error) {
|
|
42
|
+
Dynamo_Log.test('error', error);
|
|
43
|
+
}
|
|
33
44
|
});
|
|
34
45
|
|
|
35
46
|
afterEach(async () => {
|
|
@@ -43,7 +54,6 @@ describe('DynamoNTS_App;', () => {
|
|
|
43
54
|
it('should be started', () => {
|
|
44
55
|
expect(app.started).toBeTrue();
|
|
45
56
|
});
|
|
46
|
-
|
|
47
57
|
});
|
|
48
58
|
});
|
|
49
59
|
|