@futdevpro/fsm-dynamo 1.5.61 → 1.5.64
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/_models/control-models/error.control-model.d.ts +17 -13
- package/lib/_models/control-models/error.control-model.d.ts.map +1 -1
- package/lib/_models/control-models/error.control-model.js +42 -14
- package/lib/_models/control-models/error.control-model.js.map +1 -1
- package/lib/_models/control-models/error.control-model.spec.js +349 -47
- package/lib/_models/control-models/error.control-model.spec.js.map +1 -1
- package/lib/_models/data-models/metadata.data-model.d.ts.map +1 -1
- package/lib/_models/data-models/metadata.data-model.js +1 -4
- package/lib/_models/data-models/metadata.data-model.js.map +1 -1
- package/lib/_utils/log.util.d.ts +17 -11
- package/lib/_utils/log.util.d.ts.map +1 -1
- package/lib/_utils/log.util.js +26 -11
- package/lib/_utils/log.util.js.map +1 -1
- package/lib/tsconfig.tsbuildinfo +7 -8
- package/package.json +1 -1
- package/src/_models/control-models/error.control-model.spec.ts +403 -51
- package/src/_models/control-models/error.control-model.ts +62 -27
- package/src/_models/data-models/metadata.data-model.ts +1 -4
- package/src/_utils/log.util.ts +38 -21
|
@@ -8,13 +8,15 @@ describe('Dynamo_Error;', () => {
|
|
|
8
8
|
let error_base: Error;
|
|
9
9
|
let error_0: Dynamo_Error;
|
|
10
10
|
let error_stack_1: Dynamo_Error;
|
|
11
|
+
let error_stack_withoutSubErrors_1: Dynamo_Error;
|
|
11
12
|
let error_stack_2: Dynamo_Error;
|
|
13
|
+
let error_stack_withoutSubErrors_2: Dynamo_Error;
|
|
12
14
|
let error_selfDefined: Dynamo_Error;
|
|
13
15
|
|
|
14
16
|
const message_base: string = '-TEST ERROR: something failed!-';
|
|
15
17
|
const message_1: string = 'TEST ERROR MSG (1)';
|
|
16
18
|
const message_2: string = 'TEST ERROR MSG (2)';
|
|
17
|
-
const message_selfDefined: string = dynamo_error_default.message + '; error.control-model.spec.js:
|
|
19
|
+
const message_selfDefined: string = dynamo_error_default.message + '; error.control-model.spec.js:74:29';
|
|
18
20
|
|
|
19
21
|
const errorCode_0: string = 'ASD-ASD-001';
|
|
20
22
|
const errorCode_1: string = 'ASD-ASD-002';
|
|
@@ -30,6 +32,11 @@ describe('Dynamo_Error;', () => {
|
|
|
30
32
|
const issuerSystem: string = 'Dynamo_FSM TEST';
|
|
31
33
|
const issuerService_0: string = 'Service-0';
|
|
32
34
|
const issuerService_1: string = 'Service-1';
|
|
35
|
+
|
|
36
|
+
const additionalContent_1: any = {
|
|
37
|
+
test: 'test',
|
|
38
|
+
test2: 'test2',
|
|
39
|
+
};
|
|
33
40
|
|
|
34
41
|
const log: boolean = false;
|
|
35
42
|
/* const log: boolean = true; */
|
|
@@ -52,9 +59,19 @@ describe('Dynamo_Error;', () => {
|
|
|
52
59
|
errorCode: errorCode_1,
|
|
53
60
|
issuerService: issuerService_1,
|
|
54
61
|
handled: true,
|
|
62
|
+
additionalContent: additionalContent_1,
|
|
55
63
|
error: error_0,
|
|
56
64
|
});
|
|
57
65
|
|
|
66
|
+
error_stack_withoutSubErrors_1 = {
|
|
67
|
+
...error_stack_1,
|
|
68
|
+
} as Dynamo_Error;
|
|
69
|
+
error_stack_withoutSubErrors_1.errors.forEach((error: Dynamo_Error) => {
|
|
70
|
+
const subError = { ...error };
|
|
71
|
+
delete (subError as Dynamo_Error).errors;
|
|
72
|
+
return subError;
|
|
73
|
+
});
|
|
74
|
+
|
|
58
75
|
error_stack_2 = new Dynamo_Error({
|
|
59
76
|
message: message_2,
|
|
60
77
|
userMessage: userMessage_2,
|
|
@@ -63,13 +80,26 @@ describe('Dynamo_Error;', () => {
|
|
|
63
80
|
error: error_stack_1,
|
|
64
81
|
});
|
|
65
82
|
|
|
83
|
+
error_stack_withoutSubErrors_2 = {
|
|
84
|
+
...error_stack_2,
|
|
85
|
+
} as Dynamo_Error;
|
|
86
|
+
error_stack_withoutSubErrors_2.errors.map((error: Dynamo_Error) => {
|
|
87
|
+
const subError = { ...error };
|
|
88
|
+
delete (subError as Dynamo_Error).errors;
|
|
89
|
+
return subError;
|
|
90
|
+
});
|
|
91
|
+
|
|
66
92
|
error_selfDefined = new Dynamo_Error();
|
|
67
93
|
});
|
|
68
94
|
|
|
69
95
|
if (log) afterAll(async () => {
|
|
70
|
-
Dynamo_Log.testLog(
|
|
71
|
-
|
|
72
|
-
);
|
|
96
|
+
Dynamo_Log.testLog('error_stack_2:\n', error_stack_2);
|
|
97
|
+
Dynamo_Log.testLog('error_stack_2.getFlat:\n', error_stack_2.getErrorsFlat());
|
|
98
|
+
Dynamo_Log.testLog('error_stack_2.getSimplified:\n', error_stack_2.getErrorSimplified());
|
|
99
|
+
Dynamo_Log.testLog('error_stack_withoutSubErrors_2:\n', error_stack_withoutSubErrors_2);
|
|
100
|
+
Dynamo_Log.testLog('error_selfDefined:\n', error_selfDefined);
|
|
101
|
+
Dynamo_Log.testLog('error_selfDefined.getFlat:\n', error_selfDefined.getErrorsFlat());
|
|
102
|
+
Dynamo_Log.testLog('error_selfDefined.getSimplified:\n', error_selfDefined.getErrorSimplified());
|
|
73
103
|
});
|
|
74
104
|
|
|
75
105
|
describe('should be defined;', () => {
|
|
@@ -126,165 +156,165 @@ describe('Dynamo_Error;', () => {
|
|
|
126
156
|
});
|
|
127
157
|
});
|
|
128
158
|
|
|
129
|
-
describe('should have the proper
|
|
159
|
+
describe('should have the proper _errorCodes;', () => {
|
|
130
160
|
it('on error_0', () => {
|
|
131
|
-
expect(error_0.
|
|
161
|
+
expect(error_0._errorCodes).toEqual([ errorCode_0 ]);
|
|
132
162
|
});
|
|
133
|
-
|
|
163
|
+
|
|
134
164
|
it('on error_stack_1', () => {
|
|
135
|
-
expect(error_stack_1.
|
|
165
|
+
expect(error_stack_1._errorCodes).toEqual([ errorCode_0, errorCode_1 ]);
|
|
136
166
|
});
|
|
137
167
|
|
|
138
168
|
it('on error_stack_2', () => {
|
|
139
|
-
expect(error_stack_2.
|
|
169
|
+
expect(error_stack_2._errorCodes).toEqual([ errorCode_0, errorCode_1, errorCode_2 ]);
|
|
140
170
|
});
|
|
141
171
|
|
|
142
172
|
it('on self defined error', () => {
|
|
143
|
-
expect(error_selfDefined.
|
|
173
|
+
expect(error_selfDefined._errorCodes).toEqual([ dynamo_error_default.errorCode ]);
|
|
144
174
|
});
|
|
145
175
|
});
|
|
146
176
|
|
|
147
|
-
describe('should have the proper
|
|
177
|
+
describe('should have the proper _message;', () => {
|
|
148
178
|
it('on error_0', () => {
|
|
149
|
-
expect(error_0.
|
|
179
|
+
expect(error_0._message).toBe(message_base);
|
|
150
180
|
});
|
|
151
181
|
|
|
152
182
|
it('on error_stack_1', () => {
|
|
153
|
-
expect(error_stack_1.
|
|
183
|
+
expect(error_stack_1._message).toBe(message_base);
|
|
154
184
|
});
|
|
155
185
|
|
|
156
186
|
it('on error_stack_2', () => {
|
|
157
|
-
expect(error_stack_2.
|
|
187
|
+
expect(error_stack_2._message).toBe(message_base);
|
|
158
188
|
});
|
|
159
189
|
|
|
160
190
|
it('on self defined error', () => {
|
|
161
|
-
expect(error_selfDefined.
|
|
191
|
+
expect(error_selfDefined._message).toBe(message_selfDefined);
|
|
162
192
|
});
|
|
163
193
|
});
|
|
164
194
|
|
|
165
|
-
describe('should have proper
|
|
195
|
+
describe('should have the proper _messages;', () => {
|
|
166
196
|
it('on error_0', () => {
|
|
167
|
-
expect(error_0.
|
|
197
|
+
expect(error_0._messages).toEqual([ message_base ]);
|
|
168
198
|
});
|
|
169
199
|
|
|
170
200
|
it('on error_stack_1', () => {
|
|
171
|
-
expect(error_stack_1.
|
|
201
|
+
expect(error_stack_1._messages).toEqual([ message_base, message_1 ]);
|
|
172
202
|
});
|
|
173
203
|
|
|
174
204
|
it('on error_stack_2', () => {
|
|
175
|
-
expect(error_stack_2.
|
|
205
|
+
expect(error_stack_2._messages).toEqual([ message_base, message_1, message_2 ]);
|
|
176
206
|
});
|
|
177
207
|
|
|
178
208
|
it('on self defined error', () => {
|
|
179
|
-
expect(error_selfDefined.
|
|
209
|
+
expect(error_selfDefined._messages).toEqual([ message_selfDefined ]);
|
|
180
210
|
});
|
|
181
211
|
});
|
|
182
212
|
|
|
183
|
-
describe('should have proper
|
|
213
|
+
describe('should have the proper __userMessage;', () => {
|
|
184
214
|
it('on error_0', () => {
|
|
185
|
-
expect(error_0.
|
|
215
|
+
expect(error_0.__userMessage).toBe(userMessageResult_0);
|
|
186
216
|
});
|
|
187
217
|
|
|
188
218
|
it('on error_stack_1', () => {
|
|
189
|
-
expect(error_stack_1.
|
|
219
|
+
expect(error_stack_1.__userMessage).toBe(userMessageResult_0);
|
|
190
220
|
});
|
|
191
221
|
|
|
192
222
|
it('on error_stack_2', () => {
|
|
193
|
-
expect(error_stack_2.
|
|
223
|
+
expect(error_stack_2.__userMessage).toBe(userMessageResult_0);
|
|
194
224
|
});
|
|
195
225
|
|
|
196
226
|
it('on self defined error', () => {
|
|
197
|
-
expect(error_selfDefined.
|
|
227
|
+
expect(error_selfDefined.__userMessage).toBeUndefined();
|
|
198
228
|
});
|
|
199
229
|
});
|
|
200
230
|
|
|
201
|
-
describe('should have
|
|
231
|
+
describe('should have the proper __userMessages;', () => {
|
|
202
232
|
it('on error_0', () => {
|
|
203
|
-
expect(error_0.
|
|
233
|
+
expect(error_0.__userMessages).toEqual([ userMessageResult_0 ]);
|
|
204
234
|
});
|
|
205
235
|
|
|
206
236
|
it('on error_stack_1', () => {
|
|
207
|
-
expect(error_stack_1.
|
|
237
|
+
expect(error_stack_1.__userMessages).toEqual([ userMessageResult_0, dynamo_error_default.userMessage ]);
|
|
208
238
|
});
|
|
209
239
|
|
|
210
240
|
it('on error_stack_2', () => {
|
|
211
|
-
expect(error_stack_2.
|
|
241
|
+
expect(error_stack_2.__userMessages).toEqual([ userMessageResult_0, dynamo_error_default.userMessage, userMessageResult_2 ]);
|
|
212
242
|
});
|
|
213
243
|
|
|
214
244
|
it('on self defined error', () => {
|
|
215
|
-
expect(error_selfDefined.
|
|
245
|
+
expect(error_selfDefined.__userMessages).toEqual([ dynamo_error_default.userMessage ]);
|
|
216
246
|
});
|
|
217
247
|
});
|
|
218
248
|
|
|
219
|
-
describe('should have
|
|
249
|
+
describe('should have proper error;', () => {
|
|
220
250
|
it('on error_0', () => {
|
|
221
|
-
expect(error_0.
|
|
251
|
+
expect(error_0.error).toBe(error_base);
|
|
222
252
|
});
|
|
223
|
-
|
|
253
|
+
|
|
224
254
|
it('on error_stack_1', () => {
|
|
225
|
-
expect(error_stack_1.
|
|
255
|
+
expect(error_stack_1.error).toBe(error_base);
|
|
226
256
|
});
|
|
227
257
|
|
|
228
258
|
it('on error_stack_2', () => {
|
|
229
|
-
expect(error_stack_2.
|
|
259
|
+
expect(error_stack_2.error).toBe(error_base);
|
|
230
260
|
});
|
|
231
261
|
|
|
232
262
|
it('on self defined error', () => {
|
|
233
|
-
expect(error_selfDefined.
|
|
263
|
+
expect(error_selfDefined.error).toBeDefined();
|
|
234
264
|
});
|
|
235
265
|
});
|
|
236
266
|
|
|
237
|
-
describe('should have the proper
|
|
267
|
+
describe('should have the proper errors;', () => {
|
|
238
268
|
it('on error_0', () => {
|
|
239
|
-
expect(error_0.
|
|
269
|
+
expect(error_0.errors).toEqual([ error_base ]);
|
|
240
270
|
});
|
|
241
271
|
|
|
242
272
|
it('on error_stack_1', () => {
|
|
243
|
-
expect(error_stack_1.
|
|
273
|
+
expect(error_stack_1.errors).toEqual([ error_base, error_0 ]);
|
|
244
274
|
});
|
|
245
275
|
|
|
246
276
|
it('on error_stack_2', () => {
|
|
247
|
-
expect(error_stack_2.
|
|
277
|
+
expect(error_stack_2.errors).toEqual([ error_base, error_0, error_stack_1 ]);
|
|
248
278
|
});
|
|
249
279
|
|
|
250
280
|
it('on self defined error', () => {
|
|
251
|
-
expect(error_selfDefined
|
|
281
|
+
expect(error_selfDefined?.errors?.length).toBe(1);
|
|
252
282
|
});
|
|
253
283
|
});
|
|
254
284
|
|
|
255
|
-
describe('should have
|
|
285
|
+
describe('should have proper handled;', () => {
|
|
256
286
|
it('on error_0', () => {
|
|
257
|
-
expect(error_0.
|
|
287
|
+
expect(error_0.___handled).toBe(false);
|
|
258
288
|
});
|
|
259
289
|
|
|
260
290
|
it('on error_stack_1', () => {
|
|
261
|
-
expect(error_stack_1.
|
|
291
|
+
expect(error_stack_1.___handled).toBe(true);
|
|
262
292
|
});
|
|
263
293
|
|
|
264
294
|
it('on error_stack_2', () => {
|
|
265
|
-
expect(error_stack_2.
|
|
295
|
+
expect(error_stack_2.___handled).toBe(true);
|
|
266
296
|
});
|
|
267
297
|
|
|
268
298
|
it('on self defined error', () => {
|
|
269
|
-
expect(error_selfDefined.
|
|
299
|
+
expect(error_selfDefined.___handled).toBe(false);
|
|
270
300
|
});
|
|
271
301
|
});
|
|
272
302
|
|
|
273
|
-
describe('should have
|
|
303
|
+
describe('should have status: undefined;', () => {
|
|
274
304
|
it('on error_0', () => {
|
|
275
|
-
expect(error_0.
|
|
305
|
+
expect(error_0.___status).toBe(undefined);
|
|
276
306
|
});
|
|
277
307
|
|
|
278
308
|
it('on error_stack_1', () => {
|
|
279
|
-
expect(error_stack_1.
|
|
309
|
+
expect(error_stack_1.___status).toBe(undefined);
|
|
280
310
|
});
|
|
281
311
|
|
|
282
312
|
it('on error_stack_2', () => {
|
|
283
|
-
expect(error_stack_2.
|
|
313
|
+
expect(error_stack_2.___status).toBe(undefined);
|
|
284
314
|
});
|
|
285
315
|
|
|
286
316
|
it('on self defined error', () => {
|
|
287
|
-
expect(error_selfDefined.
|
|
317
|
+
expect(error_selfDefined.___status).toBe(undefined);
|
|
288
318
|
});
|
|
289
319
|
});
|
|
290
320
|
|
|
@@ -305,6 +335,24 @@ describe('Dynamo_Error;', () => {
|
|
|
305
335
|
expect(error_selfDefined.___issuer).toBe(dynamo_error_default.issuer);
|
|
306
336
|
});
|
|
307
337
|
});
|
|
338
|
+
|
|
339
|
+
describe('should have get proper additionalContent;', () => {
|
|
340
|
+
it('on error_0', () => {
|
|
341
|
+
expect(error_0.additionalContent).toBeUndefined();
|
|
342
|
+
});
|
|
343
|
+
|
|
344
|
+
it('on error_stack_1', () => {
|
|
345
|
+
expect(error_stack_1.additionalContent).toBe(additionalContent_1);
|
|
346
|
+
});
|
|
347
|
+
|
|
348
|
+
it('on error_stack_2', () => {
|
|
349
|
+
expect(error_stack_2.additionalContent).toBeUndefined();
|
|
350
|
+
});
|
|
351
|
+
|
|
352
|
+
it('on self defined error', () => {
|
|
353
|
+
expect(error_selfDefined.additionalContent).toBeUndefined();
|
|
354
|
+
});
|
|
355
|
+
});
|
|
308
356
|
|
|
309
357
|
describe('should have the proper issuerSystem;', () => {
|
|
310
358
|
it('on error_0', () => {
|
|
@@ -341,5 +389,309 @@ describe('Dynamo_Error;', () => {
|
|
|
341
389
|
expect(error_selfDefined.___issuerService).toBe(dynamo_error_default.issuerService);
|
|
342
390
|
});
|
|
343
391
|
});
|
|
392
|
+
|
|
393
|
+
describe('should have get proper simplified;', () => {
|
|
394
|
+
let simplified;
|
|
395
|
+
|
|
396
|
+
describe('on error_0;', () => {
|
|
397
|
+
beforeEach(() => {
|
|
398
|
+
simplified = error_0.getErrorSimplified();
|
|
399
|
+
});
|
|
400
|
+
|
|
401
|
+
it('should be defined', () => {
|
|
402
|
+
expect(simplified).toBeDefined();
|
|
403
|
+
});
|
|
404
|
+
|
|
405
|
+
it('should have error', () => {
|
|
406
|
+
expect(simplified.error).toBeDefined();
|
|
407
|
+
});
|
|
408
|
+
|
|
409
|
+
it('should not have errors', () => {
|
|
410
|
+
expect(simplified.errors).toBeUndefined();
|
|
411
|
+
});
|
|
412
|
+
|
|
413
|
+
it('should not have simplified.error.error', () => {
|
|
414
|
+
expect((simplified.error as Dynamo_Error)?.error).toBeUndefined();
|
|
415
|
+
});
|
|
416
|
+
|
|
417
|
+
it('should not have simplified.error.errors', () => {
|
|
418
|
+
expect((simplified.error as Dynamo_Error)?.errors).toBeUndefined();
|
|
419
|
+
});
|
|
420
|
+
});
|
|
421
|
+
|
|
422
|
+
describe('on error_stack_1;', () => {
|
|
423
|
+
beforeEach(() => {
|
|
424
|
+
simplified = error_stack_1.getErrorSimplified();
|
|
425
|
+
});
|
|
426
|
+
|
|
427
|
+
it('should be defined', () => {
|
|
428
|
+
expect(simplified).toBeDefined();
|
|
429
|
+
});
|
|
430
|
+
|
|
431
|
+
it('should have error', () => {
|
|
432
|
+
expect(simplified.error).toBeDefined();
|
|
433
|
+
});
|
|
434
|
+
|
|
435
|
+
it('should not have errors', () => {
|
|
436
|
+
expect(simplified.errors).toBeUndefined();
|
|
437
|
+
});
|
|
438
|
+
|
|
439
|
+
it('should not have simplified.error.error', () => {
|
|
440
|
+
expect((simplified.error as Dynamo_Error)?.error).toBeUndefined();
|
|
441
|
+
});
|
|
442
|
+
|
|
443
|
+
it('should not have simplified.error.errors', () => {
|
|
444
|
+
expect((simplified.error as Dynamo_Error)?.errors).toBeUndefined();
|
|
445
|
+
});
|
|
446
|
+
});
|
|
447
|
+
|
|
448
|
+
describe('on error_stack_2;', () => {
|
|
449
|
+
beforeEach(() => {
|
|
450
|
+
simplified = error_stack_2.getErrorSimplified();
|
|
451
|
+
});
|
|
452
|
+
|
|
453
|
+
it('should be defined', () => {
|
|
454
|
+
expect(simplified).toBeDefined();
|
|
455
|
+
});
|
|
456
|
+
|
|
457
|
+
it('should have error', () => {
|
|
458
|
+
expect(simplified.error).toBeDefined();
|
|
459
|
+
});
|
|
460
|
+
|
|
461
|
+
it('should not have errors', () => {
|
|
462
|
+
expect(simplified.errors).toBeUndefined();
|
|
463
|
+
});
|
|
464
|
+
|
|
465
|
+
it('should not have simplified.error.error', () => {
|
|
466
|
+
expect((simplified.error as Dynamo_Error)?.error).toBeUndefined();
|
|
467
|
+
});
|
|
468
|
+
|
|
469
|
+
it('should not have simplified.error.errors', () => {
|
|
470
|
+
expect((simplified.error as Dynamo_Error)?.errors).toBeUndefined();
|
|
471
|
+
});
|
|
472
|
+
});
|
|
473
|
+
|
|
474
|
+
describe('on self defined error;', () => {
|
|
475
|
+
beforeEach(() => {
|
|
476
|
+
simplified = error_selfDefined.getErrorSimplified();
|
|
477
|
+
});
|
|
478
|
+
|
|
479
|
+
it('should be defined', () => {
|
|
480
|
+
expect(simplified).toBeDefined();
|
|
481
|
+
});
|
|
482
|
+
|
|
483
|
+
it('should have error', () => {
|
|
484
|
+
expect(simplified.error).toBeDefined();
|
|
485
|
+
});
|
|
486
|
+
|
|
487
|
+
it('should not have errors', () => {
|
|
488
|
+
expect(simplified.errors).toBeUndefined();
|
|
489
|
+
});
|
|
490
|
+
|
|
491
|
+
it('should not have simplified.error.error', () => {
|
|
492
|
+
expect((simplified.error as Dynamo_Error)?.error).toBeUndefined();
|
|
493
|
+
});
|
|
494
|
+
|
|
495
|
+
it('should not have simplified.error.errors', () => {
|
|
496
|
+
expect((simplified.error as Dynamo_Error)?.errors).toBeUndefined();
|
|
497
|
+
});
|
|
498
|
+
});
|
|
499
|
+
});
|
|
500
|
+
|
|
501
|
+
describe('should have get proper flat;', () => {
|
|
502
|
+
let flat;
|
|
503
|
+
|
|
504
|
+
describe('on error_0;', () => {
|
|
505
|
+
beforeEach(() => {
|
|
506
|
+
flat = error_0.getErrorsFlat();
|
|
507
|
+
});
|
|
508
|
+
|
|
509
|
+
it('should be defined', () => {
|
|
510
|
+
expect(flat).toBeDefined();
|
|
511
|
+
});
|
|
512
|
+
|
|
513
|
+
it('should have error', () => {
|
|
514
|
+
expect(flat.error).toBeDefined();
|
|
515
|
+
});
|
|
516
|
+
|
|
517
|
+
describe('errors...;', () => {
|
|
518
|
+
it('should have errors', () => {
|
|
519
|
+
expect(flat?.errors).toBeDefined();
|
|
520
|
+
});
|
|
521
|
+
|
|
522
|
+
it('should have 1 errors', () => {
|
|
523
|
+
expect(flat?.errors?.length).toBe(1);
|
|
524
|
+
});
|
|
525
|
+
|
|
526
|
+
flat?.errors?.forEach((error: Dynamo_Error, index: number) => {
|
|
527
|
+
describe(`on error[${index}];`, () => {
|
|
528
|
+
it('should be', () => {
|
|
529
|
+
expect(error).toBeDefined();
|
|
530
|
+
});
|
|
531
|
+
|
|
532
|
+
it(`should have error[${index}].error`, () => {
|
|
533
|
+
expect(error.error).toBeDefined();
|
|
534
|
+
});
|
|
535
|
+
|
|
536
|
+
it(`should not have error[${index}].errors`, () => {
|
|
537
|
+
expect(error.errors).toBeUndefined();
|
|
538
|
+
});
|
|
539
|
+
|
|
540
|
+
it(`should not have error[${index}].error.error`, () => {
|
|
541
|
+
expect((error.error as Dynamo_Error)?.error).toBeUndefined();
|
|
542
|
+
});
|
|
543
|
+
|
|
544
|
+
it(`should not have error[${index}].error.errors`, () => {
|
|
545
|
+
expect((error.error as Dynamo_Error)?.errors).toBeUndefined();
|
|
546
|
+
});
|
|
547
|
+
});
|
|
548
|
+
});
|
|
549
|
+
});
|
|
550
|
+
});
|
|
551
|
+
|
|
552
|
+
describe('on error_stack_1;', () => {
|
|
553
|
+
beforeEach(() => {
|
|
554
|
+
flat = error_stack_1.getErrorsFlat();
|
|
555
|
+
});
|
|
556
|
+
|
|
557
|
+
it('should be defined', () => {
|
|
558
|
+
expect(flat).toBeDefined();
|
|
559
|
+
});
|
|
560
|
+
|
|
561
|
+
it('should have error', () => {
|
|
562
|
+
expect(flat.error).toBeDefined();
|
|
563
|
+
});
|
|
564
|
+
|
|
565
|
+
describe('errors...;', () => {
|
|
566
|
+
it('should have errors', () => {
|
|
567
|
+
expect(flat?.errors).toBeDefined();
|
|
568
|
+
});
|
|
569
|
+
|
|
570
|
+
it('should have 2 errors', () => {
|
|
571
|
+
expect(flat?.errors?.length).toBe(2);
|
|
572
|
+
});
|
|
573
|
+
|
|
574
|
+
flat?.errors?.forEach((error: Dynamo_Error, index: number) => {
|
|
575
|
+
describe(`on error[${index}];`, () => {
|
|
576
|
+
it('should be', () => {
|
|
577
|
+
expect(error).toBeDefined();
|
|
578
|
+
});
|
|
579
|
+
|
|
580
|
+
it(`should have error[${index}].error`, () => {
|
|
581
|
+
expect(error.error).toBeDefined();
|
|
582
|
+
});
|
|
583
|
+
|
|
584
|
+
it(`should not have error[${index}].errors`, () => {
|
|
585
|
+
expect(error.errors).toBeUndefined();
|
|
586
|
+
});
|
|
587
|
+
|
|
588
|
+
it('should not have error[${index}].error.error', () => {
|
|
589
|
+
expect((error.error as Dynamo_Error)?.error).toBeUndefined();
|
|
590
|
+
});
|
|
591
|
+
|
|
592
|
+
it('should not have error[${index}].error.errors', () => {
|
|
593
|
+
expect((error.error as Dynamo_Error)?.errors).toBeUndefined();
|
|
594
|
+
});
|
|
595
|
+
});
|
|
596
|
+
});
|
|
597
|
+
});
|
|
598
|
+
});
|
|
599
|
+
|
|
600
|
+
describe('on error_stack_2;', () => {
|
|
601
|
+
beforeEach(() => {
|
|
602
|
+
flat = error_stack_2.getErrorsFlat();
|
|
603
|
+
});
|
|
604
|
+
|
|
605
|
+
it('should be defined', () => {
|
|
606
|
+
expect(flat).toBeDefined();
|
|
607
|
+
});
|
|
608
|
+
|
|
609
|
+
it('should have error', () => {
|
|
610
|
+
expect(flat.error).toBeDefined();
|
|
611
|
+
});
|
|
612
|
+
|
|
613
|
+
describe('errors...;', () => {
|
|
614
|
+
it('should have errors', () => {
|
|
615
|
+
expect(flat?.errors).toBeDefined();
|
|
616
|
+
});
|
|
617
|
+
|
|
618
|
+
it('should have 3 errors', () => {
|
|
619
|
+
expect(flat?.errors?.length).toBe(3);
|
|
620
|
+
});
|
|
621
|
+
|
|
622
|
+
flat?.errors?.forEach((error: Dynamo_Error, index: number) => {
|
|
623
|
+
describe(`on error[${index}];`, () => {
|
|
624
|
+
it('should be', () => {
|
|
625
|
+
expect(error).toBeDefined();
|
|
626
|
+
});
|
|
627
|
+
|
|
628
|
+
it(`should have error[${index}].error`, () => {
|
|
629
|
+
expect(error.error).toBeDefined();
|
|
630
|
+
});
|
|
631
|
+
|
|
632
|
+
it(`should not have error[${index}].errors`, () => {
|
|
633
|
+
expect(error.errors).toBeUndefined();
|
|
634
|
+
});
|
|
635
|
+
|
|
636
|
+
it(`should not have error[${index}].error.error`, () => {
|
|
637
|
+
expect((error.error as Dynamo_Error)?.error).toBeUndefined();
|
|
638
|
+
});
|
|
639
|
+
|
|
640
|
+
it(`should not have error[${index}].error.errors`, () => {
|
|
641
|
+
expect((error.error as Dynamo_Error)?.errors).toBeUndefined();
|
|
642
|
+
});
|
|
643
|
+
});
|
|
644
|
+
});
|
|
645
|
+
});
|
|
646
|
+
});
|
|
647
|
+
|
|
648
|
+
describe('on self defined error;', () => {
|
|
649
|
+
beforeEach(() => {
|
|
650
|
+
flat = error_selfDefined.getErrorsFlat();
|
|
651
|
+
});
|
|
652
|
+
|
|
653
|
+
it('should be defined', () => {
|
|
654
|
+
expect(flat).toBeDefined();
|
|
655
|
+
});
|
|
656
|
+
|
|
657
|
+
it('should have error', () => {
|
|
658
|
+
expect(flat.error).toBeDefined();
|
|
659
|
+
});
|
|
660
|
+
|
|
661
|
+
describe('errors...;', () => {
|
|
662
|
+
it('should have errors', () => {
|
|
663
|
+
expect(flat?.errors).toBeDefined();
|
|
664
|
+
});
|
|
665
|
+
|
|
666
|
+
it('should have 1 errors', () => {
|
|
667
|
+
expect(flat?.errors?.length).toBe(1);
|
|
668
|
+
});
|
|
669
|
+
|
|
670
|
+
flat?.errors?.forEach((error: Dynamo_Error, index: number) => {
|
|
671
|
+
describe(`on error[${index}];`, () => {
|
|
672
|
+
it('should be', () => {
|
|
673
|
+
expect(error).toBeDefined();
|
|
674
|
+
});
|
|
675
|
+
|
|
676
|
+
it(`should have error[${index}].error`, () => {
|
|
677
|
+
expect(error.error).toBeDefined();
|
|
678
|
+
});
|
|
679
|
+
|
|
680
|
+
it(`should not have error[${index}].errors`, () => {
|
|
681
|
+
expect(error.errors).toBeUndefined();
|
|
682
|
+
});
|
|
683
|
+
|
|
684
|
+
it(`should not have error[${index}].error.error`, () => {
|
|
685
|
+
expect((error.error as Dynamo_Error)?.error).toBeUndefined();
|
|
686
|
+
});
|
|
687
|
+
|
|
688
|
+
it(`should not have error[${index}].error.errors`, () => {
|
|
689
|
+
expect((error.error as Dynamo_Error)?.errors).toBeUndefined();
|
|
690
|
+
});
|
|
691
|
+
});
|
|
692
|
+
});
|
|
693
|
+
});
|
|
694
|
+
});
|
|
695
|
+
});
|
|
344
696
|
});
|
|
345
697
|
|